Alistair Ward
Member
- Location
- Christchurch, New Zealand
I have just done a little exercise where I created a typed list of Tshoved_timber objects, using Generics.
uses
System.Generics;
Tshoved_timber_list = class( TObjectList<Tshoved_timber> )
end;
Using the TObjectList provides 2 main benefits:
I then went through a refactoring exercise, which was mostly quite mechanical, changing all the references appropriately. The main thing I will say is I deleted quite a lot of duplicated code and generally simplified things significantly.
Once we have a repository, I would hope we could have a good discussion regarding overall design and look at what changes we can/should make to improve the overall design.
Regards,
Alistair Ward.
uses
System.Generics;
Tshoved_timber_list = class( TObjectList<Tshoved_timber> )
end;
Using the TObjectList provides 2 main benefits:
- The list is typed - no typecasting required to access the items in the list.
- The list owns the contents - no need to free individual list items, just the list itself.
I then went through a refactoring exercise, which was mostly quite mechanical, changing all the references appropriately. The main thing I will say is I deleted quite a lot of duplicated code and generally simplified things significantly.
Once we have a repository, I would hope we could have a good discussion regarding overall design and look at what changes we can/should make to improve the overall design.
Regards,
Alistair Ward.
message ref: 452