Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subtle question
Message
 
 
À
04/02/1999 19:29:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00182331
Message ID:
00184386
Vues:
20
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform