In Delphi 2010, using Generics is the best approach.
Use this instead of your custom TBackupsList class:
TBackupsManager = class private FBackups: TObjectList<TBackupItem>;
(You must include Generics.Collections ).
If your collection needs additional methods, you can save TBackupsList and inherit it from TObjectList<TBackupItem> :
TBackupsList = class(TObjectList<TBackupItem>) public function MyAdditionalMethod: Integer; end;
EDIT: If you want to use custom TBackupsList but donβt want to have all the public TBackupsList methods available, you cannot use inheritance. Instead, you should use composition:
TBackupsList = class private FItems: TObjectList<TBackupItem> public
source share