On Tue, Jul 6, 2010 at 4:09 PM, Reimar Grabowski <reimg...@web.de> wrote: > On Tue, 6 Jul 2010 14:54:29 -0300 > Marcos Douglas <m...@delfire.net> wrote: > >> Like obj1.CreateObj() ? =) > Sounds a little generic for my liking, but at least you can guess that > there is something more going on than just returning a value, so, yes. :) > I'd rather use something like obj2 := obj1.CreateSpecialTMyObjectInstance(); > myself, which > explains why I cannot use a default constructor to create obj2. But in the > end it is all about personal style.
Well... I think use a name as CreateSpecialTMyObjectInstance() is very especific... but, as you said, in the end it is all about personal style. I think found a better way to my example. Instead to create an object using Parser.CreateMyObj(ATxt), e.g., maybe is better have an object (TMyObj) instantiated in Parser and the name of method would be Parser.GetMyObj(ATxt). The Parser fill the FMyObj field (atributte) using the ATxt parameter. Like as DataSet.FieldByName('column_name') returns a TField object. I use this style a lot, but I wanted to hear some better ideas. MD. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal