Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subtle question
Message
From
05/02/1999 11:03:46
 
 
To
04/02/1999 19:29:34
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00182331
Message ID:
00184386
Views:
18
>Yes, a container (the form) has knowledge of what it contains. The contained objects (the controls) have no knowledge of eachother. The container mediates between the contained objects.
Hello Albert,
Using the form as a meditator is certainly more in keeping with oo design, but I think I see a drawback in your approach. If the form knows of the names of the objects that it contains you cannot remove these objects or rename them without changing the form's code. If you have multiple sections of code (say assign methods for multiple form properties) that refer to the same set of controls you must track down all the references and change them.

If you decide not to track down and change the references then you must maintain all the assumptions of the code. if you wish to replace an object its replacement must have the same name. If you go one step furthur and make assumptions based on the class of the contained objects, for example calling the Requery() method of a contained listbox, you will have to ensure that any control that replaces the listbox also has a Requery() method.

I think that maintaining either the code or its assumptions could easily become quite complicated.

A few more thoughts,
Ned Ames
Ned

Reality is.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform