Last Updated: 2009 November 27
Pattern Studies
- Abstract Factory pattern shows a client
using three different factories to a basic maze, an enchanted maze and a bombed
maze from from a common set of building instructions. Each maze consists of
different types of rooms that containing doors and walls.
- Adapter pattern shows client and inheritance adaptation using figures shapes.
- Command pattern uses simulated save and quit buttons for a text editor.
- Composite pattern computes the full and discount prices of a computer system built of composite parts. Has variables in the CLIENT class
to show the "uses" relationship in BON diagram created through estudio. See the vistior pattern 1 for an alternate design.
- Decorator pattern that decorates (textually) windows with scroll and border decorators.
- Environment pattern accesses system variables.
- Observer pattern 1 Shows three symmetric temperature views of a single class that models a thermometer.
- Observer pattern 2 Example from Design Patterns and Contracts on analog and digital clocks. Illustrates co-variance.
- Singleton pattern Two teams of players share the singleton captain.
- State pattern shown through the development of three designs on pricing rental movies.
- Visitor pattern 1 Has three applications (visitors):
pricing-net, pricing-discount, and inventory. The applications are entirely in the visitors, attributes are in the visited classes. See the composite pattern for an alternate design.
- Visitor pattern 2 is used to evaluate simple arithmetic expressions and to display expressions in prefix, infix and postfix notation. The system uses eSpec to test the application.