
- Forum
- Testing
- Software Patterns
- Appropriate design pattern to use for this....
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. ...
-
06-10-2005, 04:14 PM #1swethasandy@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
-
06-29-2005, 09:49 AM #2pven 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.

Reply With Quote





