Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Communications between controls
Message
From
10/07/2001 09:50:04
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, United States
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00528400
Message ID:
00528569
Views:
16
John,

Thanks for the reply. I am using a container and the requery method is part of the container. What I am not satisfied with is how to call the requery method, since there are usually more than one container on a form. I really don't want to write something like

container1.requery()
container2.requery()
...

in the click event of the "Next","Previous" and "Save" button. I could add a form method to each form, but what I was hoping for was a more generic way of calling the requery on a form with 0 to many containers. Right now I have added a property and method to my form class. Each container 'registers' itself with the form and stores it's name in the property (array). The method calls the requery of each registered control. I'm just not sure if this is 'proper OOP'? Or should I even be worried about it?

Thanks again.

John

>Because you are dealing with multiple controls, the most important feature is encapsulation. You will either want to use a container class or a control class. The primary difference is that with a container, you can still access the contained controls. With a control class, all of the controls at run time become on homogenoeous unit. If you are familar with the VB usercontrol, it is the same thing.
>
>Whether you use a container or a control, the following applies. Have common methods at the container level that are responsible for updating and refreshing controls. Essentially, you are delegating the responsibility to the container to make sure all of the controls get updated and refreshed. This gets you out of a lot of inter-control communication. You also get out of the need for a lot of extra custom properties.
>
>The nice thing is that whether you are changing the value externally or in the Valid of a contained control, the same code will work.
>
>Finally, by using a container and not a form, you then have the flexibility of placing the class on a pageframe or on a different type of form. IMO, forms as the container for these type of forms are too implementation specific
>
>Whether this is the best way or not, I don't know. It has worked for me and from design standpoing, I think it is pretty solid.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform