Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateObject() vs NewObject()
Message
De
26/08/2007 16:32:57
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
26/08/2007 15:44:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01249678
Message ID:
01250526
Vues:
27
>>>>Picky, picky! ;) I'm only trying to use some pseudo pseudocode to say "detect if the specified vcx file name is already opened/available/whatever" which in this case is easier said in code.
>>>>
>>>>How about "\VCXNAME.VCX" $ SET('CLASSLIB')
>>>
>>>But then your factory can know not only the name of the class to use, but the location of the classlib as well - it can be stored in factory.dbf. So you only need to know the name and location of the class once, when you create the record in factory.dbf.
>>
>>Absolutely. That's the point of the abstract factory.
>
>And (don't you feel the deja vu creeping in?) the difference between abstract factory and a concrete factory is?

Better Deja Vu than Vuja De. The feeling you've never been to a place before. :)

The last discussion did not clarify abstract or concrete for me. A factory that has a hard-coded class name is concrete, but one that uses a table or other file is abstract.

The definition seems to be an abstract factory decides which of a set of factories to use to instantiate a class.

However, abstract usually means not instantiated, like a parent class for concrete factories.

>>> No Set ClassLib/Procedure at all.
>>
>>The factory would have to issue these.
>
>If factory uses newobject() then it doesn't need these at all. Both lists can remain empty.

True

>I see a different problem with factory: it returns an object, which then needs to be assigned to something. It can't replace this.addobject() and this.newobject(), unless we pass This as a parameter. Does your factory do that?

Hi Dragan

All that would require is that the factory have a method to return the classname, no?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform