Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Separate public object or property of public obj?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01319132
Message ID:
01319157
Vues:
19
>>Hi,
>>
>>I am looking for suggestions to the following decision I have to make:
>>
>>I have a public object (oApp) already working in the application. Now I need to add an object (also public) that will have a bunch of methods that I want to have available in every place of the application. I can add this new object to the application as a public object or I can add it as a property of the already existing one (oApp). For example:
>>
>>
>>*-- Choice 1:
>>public oCommon
>>oCommon = newobject("common_functions","my_commonlib.vcx")
>>
>>*-- Choice 2:
>>*-- public object oApp already exist.
>>oApp.oCommon = newobject("common_functions","my_commonlib.vcx")
>>
>>
>>What is a better approach in terms of memory management?
>>
>>Thank you.
>
>I'm not sure which is better in terms of memory management. In terms of OOP, neither is appropriate IMO. You're trying to emulate the old dBASE procedure library. The correct way to do this IMO is to build the class library into your application and then instantiate objects and call methods as needed.
>
>If you really want SET PROCEDURE behavior, that's still available to you, no need to use a class or object at all.

Thank you, Mike.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform