Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for success of CreateObject?
Message
From
30/04/2009 14:30:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/04/2009 14:08:48
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01397276
Message ID:
01397289
Views:
62
>Is this overkill, or do most programmers actually do this with every CreateObject request? Or should I just pay attention to what I am doing and rely on my manual testing to make sure I did it correcty?

Not every... only those which go through a factory, which should be all of them :).

A factory object creates objects for you, does the checking and returns .null. if there's an error. The examples on how to write your own factory can be found, though the Fox Wiki mentions "abstract factory" - which is just a horseshoe on a frog, i.e. "abstract" in the factory was actually related to C++ as in "this factory doesn't need to know the names of available classes, only the names of concrete factories", whereas a concrete factory was the one capable of creating an object from a specific family, so they could be compiled separately, independently and whatnot... simply because in those days such limitations applied to compilers which didn't keep the names of everything lying around, so getting a class and library name from a table and just creating an object out of two such strings was out of the question.

Not so in VFP - you can do that, and it's often done.

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