Showing posts with label UML. Show all posts
Showing posts with label UML. Show all posts

Thursday, October 22, 2015

Question:

Consider a workflow system supporting software developers. The system enables managers to model the process the developers should follow in terms of processes and work products. The manager can assign specific processes to each developer and set deadlines for the delivery of each work product. The system supports several types of work products, including formatted text, picture, and URLs. The manager, while editing the workflow, can dynamically set the type of each work product at run time. Assuming one of your design goals is to design the system so that more work product types can be added in the future, which design pattern would you use to represent work products? Draw a UML class diagram to connect the classes namely WorkflowSystem, WorkProduct, WorkProductContent, TextContent, PictureContent, and URLContent.

Answer:

We use a bridge pattern. The interface class stores the deadline and type of work product and provides the interface to the rest of the application. The implementor classes store the content of the work product and can be substituted at run time. All implementor classes comply to the same abstract WorkProductContent interface.


Consider an existing game of bridge written in Java. We are interested in integrating this bridge game into ARENA. What is ARENA? ARENA is a multi-user game management system. Which design pattern would you use? Draw a UML class diagram relating the ARENA objects with some of the classes you would expect to find in the bridge game.


Guide: Integrating an existing game requires writing one adapter per ARENA class in the game interface.


Zul Ameen Blog © 2013 | Powered by Blogger | Blogger Template by DesignCart.org