Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to keep names of Objects
Message
From
18/05/2001 07:53:43
 
 
To
18/05/2001 06:41:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00508616
Message ID:
00508622
Views:
22
Hi!

Another approach is to use the objects container where you can add any object with watever name you want and class you want. For example, you have a public object oApp that is a custom class object. When you running one application, you do following:
oApp.AddObject('MyFunctions','Module1Functions')
Say, you require to use another set of the functions in your application. Now you do following:
oApp.AddObject('MyFunctions','Module2Functions')
The class name and class library could be stored in some system configuration table.

This way you will not need to recompile all modules at all, just provide another class library and change the class name/libraray in the config table. With your approach, each time you change the object name in the constant in the .H file, you require to recompile the entire project. Let object name is constant, just change a class on the fly ;)

>Morning
>
>I have various programs in my application that will sometimes need to identify the area that the user is currently in by referencing the Class Object Name (Ie the currently visible object will be the area that the user is in).
>
>However, I am a bit hesitant to go ahead and hard-code these names in to my programs in case they ever change.
>
>I was thinking of keeping the Object names I need in a compile-time constant in a H file.
>
>All I want to know is, is that the best way to handle this?
>
>Thanks
>Kev
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform