[fpc-devel] class abstract, class sealed implementation. please review.

Graeme Geldenhuys graemeg.lists at gmail.com
Sat Oct 17 00:09:37 CEST 2009


2009/10/16 Sergei Gorelkin <sergei_gorelkin at mail.ru>:
>
> Sealing does not prevent reusing in form of aggregation (when the sealed

Aggregation is now always the best design. Inheritance is often used.


>
> These cases use precisely aggregation, so, in fact, the code of TObjectList,
> etc. wouldn't change if TList was sealed.

Yes some use aggregation, but some also use inheritance. In fact
TObjectList *does* use inheritance - not aggregation.  See class
definitions below:

  TClassList = class(TList)
  ...
  end;

  TObjectList = class(TList)
  ...
  end;

  TComponentList = class(TObjectList)
  ...
  end;



-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list