Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application Object Best Practices 2
Message
From
30/07/2011 18:55:09
 
 
To
29/07/2011 19:21:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01519662
Message ID:
01519715
Views:
101
>Hi Experts,
>
>I have decided to have an Application Object, with its associated 'member objects' attached to it, like so:
>
>oApp = CREATEOBJECT( "myApplication" )       && also instantiates oMember1, oMember2...
>
>My question is, should other objects be able to 'directly' get hold of the member objects like so:
>
>oApp.oMember1.SomeMethod()
>oApp.oMember2.SomeOtherMethod()
>loMember1 = oApp.oMember1
>loMember1.SomeMethod()
>
>Or, should the Application Object provide an 'interface' to them, like so:
>
>oApp.SomeMethodofMember1()     && will call This.oMember1.SomeMethod()
>oApp.SomePropertyofMember1     && will access This.oMember1.SomeProperty
>
>oApp.SomeMethodofMember2()     && will call This.oMember2.SomeMethod()
>oApp.SomePropertyofMember2     && will access This.oMember2.SomeProperty
>
>Thanks In Advance
>Dennis

I tend to agree that the first way is easier unless ... you might need to access these objects through a COM connection. That is, another VFP (or other) object might need to call those methods. In that case, you're better off having methods at the app object level, even if they're only wrappers for the lower-level calls.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform