Exforsys
+ Reply to Thread
Results 1 to 6 of 6

suggestion needed for GUI design

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 the ...

  1. #1
    junchi.tang@gmail.com Guest

    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?




  2. #2
    Ted Hill Guest

    Re: suggestion needed for GUI design

    The mediator pattern.



  3. #3
    paperless Guest

    Re: suggestion needed for GUI design

    How? And why not "State" pattern.




  4. #4
    Ted Hill Guest

    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.



  5. #5
    Andrew McDonagh Guest

    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



  6. #6
    paperless Guest

    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.




    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...