Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Appropriate design pattern to use for this....

This is a discussion on Appropriate design pattern to use for this.... within the Software Patterns forums, part of the Testing category; Hi, I'm a java developer. We have a new requirement to split our existing application code that creates different menus. ...

  1. #1
    swethasandy@gmail.com Guest

    Appropriate design pattern to use for this....

    Hi,

    I'm a java developer. We have a new requirement to split our existing
    application code that creates different menus. Currently, this is done
    by a single class file that creates the menu items and displays them on
    the UI.

    The requirement is that the menu items that needs to be created can
    change based on the device type and underlying protocol being used and
    hence the application may have different menus, that can vary based on
    where this application is running from i.e. which device type and which
    protocol used for communication? So, we would like to seperate the
    creation of menu items in such a way that the common behavior is in the
    base class and the protocol and device specific behavior is achieved in
    the derived classes. Also, the order of the menu items must be
    preserved across different model types and protocol implementation i.e.
    if the menus are displayed in a particular order on one model type, the
    order must remain the same of a different model type and same with the
    protocol specific order.

    We are currently thinking of using a Mediator pattern for this, but I
    would like to know if there is a more appropriate design pattern to use
    to address this problem instead of a Mediator pattern.

    Thanks,
    Sam




  2. #2
    pven Guest

    Re: Appropriate design pattern to use for this....

    Hi,

    Can you check the Builder Design pattern.

    It allows you to construct different products ( menu's)
    run-time using an common alogrithm for construction.




Latest Article

Network Security Risk Assessment and Measurement

Read More...