В письме от Thu, 14 Jan 2010 18:50:50 +0400, Andreas Schneider
<ak...@gmx.de> сообщал:
Can FPC have default class properties in Delphi mode or even ObjFpc mode?
i probably won't really do it, for my major concern is still Delphi, and
that makes a special note that "defaul" and "class" are mutually exclusive.
Pity... i wished to do a light-weight factory (which Delphi class
references are to an extent). I would have to resort to global procedure,
but that is less elegant.
And calling TClassName.a(DataPayload) is awful. TClassName[DataPayload]
would be neat...
I think they come in very handy for the Singleton OOP concept. You need
to
have a "factory" that handles the object query/instantiation. If no
instance
is available, it creates a new one (and stores it) and if one is already
available, it just returns that.
Naturally that looks better to have TSomeClass.GetInstance() instead of
GetInstanceOfSomeClass() ...
Sure, it's possible to do without class methods, but from an OOP
viewpoint it
just looks and feels wrong ;-) (imho)
--
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal