[fpc-pascal] Re: How to make class constructor body calls descendant's overriden method/property?

2012-11-17 Thread leledumbo
> Tell the user of the framework to do something like this for every > class of your model: > > initialization > TUser.RegisterClass; > TProduct.RegisterClass; > ... > > or > > initialization > RegisterClasses([TUser, TProduct, ...]); Seems like this is the most feas

Re: [fpc-pascal] How to make class constructor body calls descendant's overriden method/property?

2012-11-17 Thread Joao Morais
On Sat, Nov 17, 2012 at 12:48 PM, leledumbo wrote: > Cross posted from stackoverflow: > http://stackoverflow.com/questions/13431079/how-to-make-class-constructor-body-calls-descendants-overriden-method-property > > I'm writing an ORM framework and got stuck in a way to automatically > determine ta

Re: [fpc-pascal] How to make class constructor body calls descendant's overriden method/property?

2012-11-17 Thread JC Chu
A CLASS CONSTRUCTOR is a special CLASS STATIC method executed during unit initialization. Because it is CLASS STATIC, Self is undefined (and thus (1) what you write for ClassName in TghModel.Create really stands for TghModel.ClassName, and (2) if TUsers inherits it, the same code will be executed)

[fpc-pascal] How to make class constructor body calls descendant's overriden method/property?

2012-11-17 Thread leledumbo
Cross posted from stackoverflow: http://stackoverflow.com/questions/13431079/how-to-make-class-constructor-body-calls-descendants-overriden-method-property I'm writing an ORM framework and got stuck in a way to automatically determine table name from class name. In my base object for the ORM to wo