Hi, I have been reading a lot of posts on the UI Controller and recently came across some on the Mediator pattern too. I have a Controller for my UI which currently 1. handles all actions on the UI. 2. also takes care of enabling/ disabling buttons and menu items based on the selections(so each component does not need to know the behaviour of the others)
If my understanding is correct, the latter is normally done by a Mediator class. Would I be right in saying that my Controller is also my Mediator? Or would I need another mediator class though I fail to see the need for it. Pls shed some light on this as I am quite confused. Venita.
Hi Venita, That sounds like a Mediator to me. In the normal implementation of the Mediator Pattern, there is one class responsible for keeping all the Colleagues in synch. For this assignment I used a variation in which the Colleagues were responsible for keeping their own state in synch base on dispatched properties thru the Mediator. Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Joined: Sep 11, 2002
Hi Michael, I took a look at a post where you've discussed the Component Mediator using a PropertyChangeListener and it is very impressive, but since this is a lot new to me, would like to give it some more thought before I go into it. My question is: is it possible for a Controller to be a mediator at the same time? Or is Controller a misnomer in this case? Venita.
Joined: Jan 30, 2002
My question is: is it possible for a Controller to be a mediator at the same time? Or is Controller a misnomer in this case?
I would say yes, it's just a matter of semantics. One would think of a Controller controlling a single object and a Mediator as controlling multiple objects, but that characterization is not always true. Michael Morris