Thursday, October 9, 2008

Catalog of Design Patterns

  1. Abstract Factory - provides an interface for creating families of related or dependent object without specifying their concrete classes.
  2. Adapter - converts the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
  3. Bridge - decouples an abstraction from its implementation so that the two can vary independently.
  4. Chain of Responsibility - Avoids coupling the sender of a request to its receiver by giving more than one object a change to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. {Could this be use in AI?}
  5. Command - encapsulates a request as an object, thereby letting me parameterize clients with different requests, queue or log requests, and support undoable operations.
  6. Composite - composes objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
  7. Decorator - attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
  8. Facade - provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
  9. Factory Method - defines a interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
  10. Flyweight - is used to support sharing a large number of fine-grained object efficiently.
  11. Interpreter - given a language, define a represention for its grammar along with interpreter that uses the representation to interpret sentences in the language.
  12. Iterator - provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
  13. Mediator - defines an object that encapsulates how a set of objects interact.
{more to be done}

No comments: