Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why don't ...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00212631
Message ID:
00213915
Vues:
33
>>How can any object resize itself with out taking ALL the other objects on the form and the form it's self into account.

There are two things here:

1. Resizing objects
2. Making sure that resized objects are compatible with other objects

The first, resizing of an object, should be done by the object itself. The object should not care about other objects. When you tell the object to go resize itself, it should, regardless of the context, which gets to the second thing, the context...

In this scenario, you really need to have a delegator, which tells all the objects to resize themselves. The delegator is aware of the context. The context in this case is the population of objects and how they relate to one another. It is the delegator's responsibility to know what message to send each object. It is the object's responsibility to deal with the message, regardless of the consequences. Doing anything else, will place too much implementation specific code in the specific classes. Or worse yet, require the need to write implementation specific code all of the time. With a delegator, you write the code once, in one place.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform