Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP objects talking to each other
Message
From
19/12/2002 09:12:15
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00729821
Message ID:
00734456
Views:
56
Do you mean the session object in VFP?

What I'm trying to get my head around is communicating with the mediator in the middle-layer, without forms or other container objects.

If I could avoid using the visual objects, it would be nice, as I would rather it worked that way.

Kev

>Just make sure you use :
>
>llOk = this.parent.beawareofsomething(this)
>
>
>instead of :
>
>llOk = thisform.BeAwareOfSomething(this)
>
>
>Then you can easily transport these objects to a middle tier by placing them into a session.
>
>Glenn
>>Right, the only problem I'm going to have is that these custom objects are going to be middle-tier one day, if their mediator is sitting in the front-end, it's not going to work.
>>
>>Kev
>>
>>>In this case, the form IS the mediator and container. The form is the parent object which has complete disposal of its contained objects.
>>>
>>>Glenn
>>>
>>>>Glenn
>>>>
>>>>In VFP, what would be the best method to create a mediator with child objects? If I have a group of custom-based objects, that require a mediator, how will these objects communicate with their mediator if they are, for example, dropped onto a form? Would the mediator have to be a container class? What if a form needs to directly address one of the child objects?
>>>>
>>>>Sorry for all the questions.
>>>>Kev
>>>>
>>>>
>>>>>Yes, the reason and rationale for all this extra "plumbing" is to allow a more flexible structure. When sibling objects message each other there is a co-dependency established between these two objects. When an object communicates with it's container it allows extended functionality without further binding multiple siblings. Calling container methods and properties is one way of obtaining a loosely coupled structure. Broadcasting an event is another, however VFP is not very good at raising events.
>>>>>
>>>>>I am sure that after employing this methodology for a while you will find that it enables you to do far more with less re-rigging of the code. I discovered the need for loosley coupled components after doing it the wrong way and causing myself to pour over code in many objects looking for co-references. When using the parent / child type relationship there is only one place to look for functioal code relative to a certain behavior. Tightly coupled objects cause much interdependency and thus a more brittle and fragile structure which will be very difficult to modify and maintain.
>>>>>
>>>>>Glenn
>>>>>
>>>>>
>>>>>>>BINGO! Today you get a gold star. Good job!
>>>>>>>
>>>>>>>Glenn
>>>>>>
>>>>>>Still seems like unecessary work trying to accommodate all of this!
>>>>>>
>>>>>>I still have a question though, before I get a book, and that is, if you want to obtain a property value from another object, under the same mediator, do I need to call a method from the mediator, which will return the value?
>>>>>>
>>>>>>Thanks
>>>>>>Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform