subsections:


A catalogue of design patterns

 [GOF94]



slide: A catalogue of design patterns


pattern schema


Name -- handle

Problem -- when to apply

Solution -- general arrangement

Consequences -- tradeoffs


slide: The pattern schema


design for change


slide: Causes for redesign


Creational patterns

See Pattern Lectures


slide: Creational patterns

Structural patterns

PatternAliasRemarks
Composite part/whole collections of components
Flyweight handle/body extrinsic state, many objects
Adaptor wrapper resolve inconsistency between interfaces
Bridge handle/body relate abstraction to implementation
Decorator handle/body to introduce additional functionality
Facade handle/body provides unified interface
Proxy handle/body to defer ... remote, virtual, protection

Behavioral patterns

cooperation

  • algorithms and the assignment of responsibilities between objects

class

  • Template Method -- the skeleton of an algorithm
  • Interpreter -- to evaluate expressions

object

composition

  • Mediator -- provides indirection
  • Chain of Responsibility -- connect objects to interact
  • Observer -- to handle dependencies

slide: Behavioral patterns


Encapsulating behavior

objectify!


slide: Encapsulating behavior


Observer

Consequences


slide: Observer pattern



slide: The Observer pattern