Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiating different Form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00845084
Message ID:
00845183
Vues:
19
Hi Mathias,

Do a search for the "Abstract Factory" design pattern. I think that's the sort of thing you need to implement in this case.

Good luck!

Alex


>Has anyone ever attempted to achieve this:
>
>I am working with a vfp application (vfp6) that's allows me to launched subclassed versions of forms by way of associating the class id with the actual class name to instantiate. That worked fine until now.
>
>This time I need to create 3 different subclasses of the same form. The application is hard coded to only instantiate one of these form. But I have classes A, B and C.
>
>What I would like to do is associate the applications’ form id to say class A. But somewhere when A is being instantiated (in the load say) put the logic for this class do decide which class to actually instantiate. Based on the logic A will abandon itself and create B or C instead without the calling code knowing any of this.
>
>Some kind of on-demand loading but the demand will be within the form class that first tries to get created.
>
>If you have any clues or indeed know how to achieve this, please help.
>
>Thanks
Low-carb diet not working? Try the Low-food diet instead!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform