This is a discussion on suggestion needed for GUI design within the Software Patterns forums, part of the Testing category; Hi, I am designing a GUI application with a lot of controls on a dialog box. The disable/enable or ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
suggestion needed for GUI design
Hi,
I am designing a GUI application with a lot of controls on a dialog box. The disable/enable or the default value of the controls will be dependent on each other, also any actions made by the application(click a button, ...) will cause some control been disabled while other been enabled. Any suggestion for an elegant solution on this? Is there any pattern to address this issue? |
|
|||
|
Re: suggestion needed for GUI design
paperless wrote:
> How? And why not "State" pattern. > Because there are many gui controls that affect each other. Use mediator: each control talks to the mediator. The mediator 'maintains state' and sends notifications to other controls so they can enable/disable themselves, etc. The mediator also talks to the 'data model' rather than having individual controls going directly to the model. |
|
|||
|
Re: suggestion needed for GUI design
Ted Hill wrote:
> paperless wrote: > >> How? And why not "State" pattern. >> > > Because there are many gui controls that affect each other. > > Use mediator: each control talks to the mediator. > > The mediator 'maintains state' and sends notifications to other controls > so they can enable/disable themselves, etc. > > The mediator also talks to the 'data model' rather than having > individual controls going directly to the model. hmm...maybe I'm reading you wrong, but...Mediate doesn't usually maintain the state. It maintains the relationships of numerous objects, so that they need not know about each other. Unless you are you saying to use A Mediator as a top level controller (as in MVC Controller). In that case, the (Hierarchical) HMVC pattern helps tremendously with the interaction of smaller GUI panes/widgets. ModelViewPresenter is a good alternative to the standard MVC, especially when there is only ever going to be one View - as in a dialog Window. Andrew |
|
|||
|
Re: suggestion needed for GUI design
Mediator maintains state, where u read that buddy? r u trying to be clever by manipulating role of "controller" in MVC pattern to "Mediator pattern. Mediator is not for enable/diable the GUI components. This is job of "View" to decide depending on "State"/"Event". Whether many gui controls r there or less, cant introduce one more thing called "mediator" in alraedy nicely built pattern, called MVC. Let the "View" decide whether to remain enable/diable itself. |