Last Updated: 2009 November 27

Pattern Studies

  1. 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.

  2. Adapter pattern shows client and inheritance adaptation using figures shapes.

  3. Command pattern uses simulated save and quit buttons for a text editor.

  4. 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.

  5. Decorator pattern that decorates (textually) windows with scroll and border decorators.

  6. Environment pattern accesses system variables.

  7. Observer pattern 1 Shows three symmetric temperature views of a single class that models a thermometer.

  8. Observer pattern 2 Example from Design Patterns and Contracts on analog and digital clocks. Illustrates co-variance.

  9. Singleton pattern Two teams of players share the singleton captain.

  10. State pattern shown through the development of three designs on pricing rental movies.

  11. 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.

  12. 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.