Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing controls from a form
Message
From
09/03/2021 10:18:38
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/03/2021 09:22:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01678811
Message ID:
01678833
Views:
35
>In his example he/factory class wraps the act of setting of the string. base class might work by setting cClass value via case, subclass via table, other via hash string or array - so you might have a factory deciding which factory to use as object factory.
>
>
factory = createobject(m.lcSubtype + "_" m.lcFactoryType)
>
>;-)

This is something coming from C++, where you simply couldn't just have one factory to make them all, language not being capable of creating an object whose class is not a literal, but rather a string contained in a variable. So it had to have one factory for each class... altogether complicated, and completely unnecessary in Fox.

In Fox, I've seen factories which had to handle a total of four cases: with/without parent, using create/addobject or newobject. Plus the complication of having to pass parameters to the object's .init() had to be handled, but that was done via macro or execscript(). But all that code was in one class, in one .prg with less than 100 lines.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform