Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Factory Objects - practical application
Message
De
15/12/2006 13:00:04
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
15/12/2006 12:13:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01177742
Message ID:
01178063
Vues:
40
>You might also create a set_datasession method in the relevant clases.
>
>Anyway I prefer a factory to produce an object and not just tell me the class name. In special cases a CreateObject() might not even work, if I wanted to create an object based on a class within another EXE or APP, I'd need NewObject().

Seems the factory should use newobject then. The calling code should not know any of that though, right? The table driving the factory would specify the exe?

> I might also want to create an object based on "empty", so the factory could produce this by Createobject("empty") and

OK.

>add properties/subobjects to it, then hand out the ready to use object.

That last would require a subclassed factory that would be able to build a special empty object. A single abstract factory could create a factory object which would build that customized empty object. Right?

Thanks!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform