Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating temporary instances of a class
Message
De
20/11/2007 10:03:08
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
20/11/2007 09:38:32
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01270154
Message ID:
01270164
Vues:
25
>I'm trying to get my head around a concept that I think I need to implement. I have a class that is going to instantiate instances of another class. The first class is a port listener, and the second class is also a listener, but does processing of data also. The first one needs to create instances of the second one, then as they are done, the instances die a (hopefully) graceful death. I'm trying to use SYS(2015) to create unique names for each instance, but I can't figure out how to do that. The define of the "EMPS_Server_Class" is set. So, if I try something like the code below in the first class, it does not find the one with the unique name. I understand why this is, but how do I get around it?
>
>
>oxServer = CREATEOBJECT( "EMPS_Server_Class_" + SYS(2015) ,m.Port )
>
Take a look at the factory design pattern. I think this is what you're talking about.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform