Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh order problems
Message
From
11/01/1999 17:01:13
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00174120
Message ID:
00174854
Views:
23
>Hi Terry,
>
>>Now I need to do validation on say object o2. o2 is phisically below the other objects on the screen, is later in order than the other objects, and is dependant on information in o6 above it (physically). When I use the information from o6 to validate o2 during a refresh I endup validating based on out of date information which has not yet been refreshed. My solution up till now has been to re-refresh o2 in the refresh method of o6 to get it to work correctly - very inefficient and VERY hard to maintain.
>
>In this case I'd use a mediator pattern. It's a design pattern than encapsulates dependancies between object and therefore reduces the sort of coupling you experience. Usually it's implemented as a separate class or within the form.
>
>For example you could create a method Validate() which receives the object name as parameter. Within this class you can write all the dependencies. This means still that you have to maintain all dependecies, but they are all in one place and therefore easier to maintain. The part for o2 for example could be:
>
> Case tcObjName == "O2"
> Thisform.o6.Refresh()
> Thisform.o2.Refresh()
> llValid = Thisform.o2.Validate()
>
>Christof

Thanks Christof

This is sort of like what Ed suggested. He suggested putting something in to replace the ThisForm.Refresh method. That has the advantage of not waisting time repeating refreshes. On the otherhand having an independent routine like this one is safer for encapsulation reasons.

Dave's first suggestion works great for small changes like Empployee Classification to bring it to the top. Then the normal processing handles it fine. But as he stated it can be a hasle for more massive changes.

Thanks for the help you guys have given me some things to explore.

Isn't it nice not to be alone.

Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Previous
Reply
Map
View

Click here to load this message in the networking platform