Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Hi,
if you don't want that Form1 knows of Form2 and vice versa, introduce a third component, a mediator. Each Form will give that mediator a reference to itself at creation and informs the mediator of important variable or field chages. The mediaor then takes the approriate steps, eg refreshes Form1 if Form2 reports a change of a setting on which Form1 depends.
So the mediator is a behaviour object knowing what trigger what. You may also let Forms bind to a certain event within the mediator, so that it the intelligence could also stay in the forms.
In this case of forms, you could put the mediator logic into your form handler, if you have one. In general a mediator is somthing like the moderator of a talk show, it's a design pattern.
Bye, Olaf.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement