Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating temporary instances of a class
Message
From
20/11/2007 10:03:08
John Baird
Coatesville, Pennsylvania, United States
 
 
To
20/11/2007 09:38:32
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01270154
Message ID:
01270164
Views:
26
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform