design pattern note

The best way to use patterns is to load your brain with them and then recognize places in your designs and existing applications where you can apply them.

Design Principle    Identify the aspects of your application that vary and seperate them from what stays the same.

All ptterns provide a way to let some port of a system vary indepentently of all other parts.

Design Principle    Program to an interface, not an implementation.

Design Principle    Favor composition over inheritance.

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.

Design Principle   Strive for loosely coupled designs between objects that interact.

Design Principle  Classes shoud be open for extension, but close for modification.

The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.