Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Separate public object or property of public obj?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01319132
Message ID:
01319138
Views:
22
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform