Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interaction between biz obj - design question
Message
From
26/02/2005 02:02:19
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00990572
Message ID:
00990845
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hello Nadya,
Yes, Event objects will do what you're looking for, as Paul suggested. Our rule of thumb is that once we have more than 2 objects collaborating, we move the code to an event object.

Since this is a more abstracted layer, the event should be the only object that "knows" how to coordinate already existing methods provided by the participating entities. This makes for loose coupling... one of the "best" OOP practices. In this case, you would have a method in the Event object that would call somemethod() on the Calendar object.

Also, check out GetBizObject() in kBizObj. It has the means for preventing circular references should you decide that it makes more sense to have the secondary objects instantiated by the primary one.

Hope that helps,
---J

>Hi everybody,
>
>For batch process which is going to be run at night I'm instantiating a biz obj in the program. I found, that I need to use some logic from another biz object. I may want to use more biz objects.
>
>So my question is how to approach this the best way:
>
>1. Put all biz objects into container and then I want to use some methods or properties from other object in the first object use:
>
>
>this.parent.CalendarObject.somemethod()
>
>
>2. Create an object reference in my main object. In its PostInitHook do something like
>
>this.NewObject('CalObj',"CalendarObject")
>
>
>What is the preferable method?
>
>Thanks a lot in advance.
Previous
Reply
Map
View

Click here to load this message in the networking platform