Wednesday, April 22, 2009

Design Patterns

Definitions on this blog came from the book Head First Design Patterns.

  • Strategy pattern - defines a family of algorithms, ancapsulate each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

  • From http://www.ida.liu.se

  • Observer pattern - defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
    - think Swing/GUI

  • From http://kur2003.if.itb.ac.id

    Using Java's built-in Observer pattern (allows observer to pull data from observable)...
    From http://kur2003.if.itb.ac.id


  • Decorator pattern - attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
    - think Java I/O

  • From http://oreilly.com



Ref:
Head First Design Patterns by By Eric Freeman, Elisabeth Robson, Kathy Sierra, and Bert Bates

No comments:

Post a Comment