About the application
This application is implemented to demostarte the design patterns. This application is developed using all major (current) design patterns (except FlyWeight pattern). The purpose of the application is to provide better understanding of design patterns in an interactive manner.
What the application does and How?
Application has the applet interface with approirate components like button, list, to interact (uses builder pattern).
User can create shapes likes Rectangle, Triangle and Circle (uses factory pattern) and decorate with color (uses decorator, visitor patterns) or directly create a colored shape object (uses abstract factory pattern). The created object can be added to the shape container (uses composite pattern) and the container has four slots, so the shapes are added or removed based on the state of the container (uses state, singleton patterns). The created object can be cloned (uses prototype pattern) and added to the container again. User can undo the operation of create shape (uses memento pattern). All the user events are handled by the applet (uses facade, observer pattern) and delegate to approriate objects. The respective objects handles the requests and results are provided to the user by refreshing/repainting the GUI (uses strategy, adapter,command, mediator, proxy patterns).
Application interaction
- Select the shape name from the list box and click the Get Shape button to create shape
- Select the color name from the list box and click the Get Color button to set the color
- Select the shape and color name from the list box and click the Get Colored Shape button to create colored shape
- Click the Decorate button to decorate the shape with the set color
- Click the Add to Conatiner button to add the shape to the shape container
- Select a shape from the shape container and click the Remove from Conatiner button to remove the shape from the shape container
- Select a shape from the shape container and click the Clone the selected object button to clone the shape
- Click the Undo the last creation operation button to undo the last created shape
Class diagram of the application
Developers:
Prathab K
Mukesh Kumar Gupta