On Sun, 16 Aug 2009, Paul Ishenin wrote:
Michael Van Canneyt wrote:
I never understood the need for it. RTTI is more than enough
for 99.99% of the cases.
Imagine you have a db framework which maps delphi classes to database tables.
It reads class properties from the rtti and creates db tables automatically.
For example:
TStudent = class(TPersistent)
published
property ID: Integer read FID write FID;
property Name: String read FName write FName;
property Age: Integer read FAge write FAge;
property Group: String read FGroup write FGroup;
end;
How db framework can create a table based on this information? It needs some
more info about field types, primary keys.
But that needs to be registered separately anyway, because this varies on
the storage back-end. The object-db mapping should never be in the object
itself, that is bad design.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel