- Abstract Factory - provides an interface for creating families of related or dependent object without specifying their concrete classes.
- 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.
- Bridge - decouples an abstraction from its implementation so that the two can vary independently.
- 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?}
- Command - encapsulates a request as an object, thereby letting me parameterize clients with different requests, queue or log requests, and support undoable operations.
- Composite - composes objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
- Decorator - attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
- 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.
- 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.
- Flyweight - is used to support sharing a large number of fine-grained object efficiently.
- Interpreter - given a language, define a represention for its grammar along with interpreter that uses the representation to interpret sentences in the language.
- Iterator - provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
- Mediator - defines an object that encapsulates how a set of objects interact.
Thursday, October 9, 2008
Catalog of Design Patterns
Describing Design Patterns
Pattern Name and Classification
Intent
Also Known As
Motivation
Applicability
Structure
Participants
Collaborations
Consequences
Implementation
Sample Code
Known Uses
Related Patterns
Intent
Also Known As
Motivation
Applicability
Structure
Participants
Collaborations
Consequences
Implementation
Sample Code
Known Uses
Related Patterns
Model/View/Controller (MVC)
The Model/View/Controller is used in Smalltalk and is an example of an Observer design pattern.
It also contains the Composite design pattern.
It also contains the Composite design pattern.
Friday, October 3, 2008
Four Essential Elements to a Design Pattern
- Pattern Name - the handle used to describe a design problem, its solutions, and consequenes. Allows design at a higher level of abstraction.
- Problem - describes when to apply the pattern. Describes the problem and its context.
- Solution - describes the elements that make up a design, their relationships, responsibilities, and collaborations. A template that can be applied in many different situations. Provides an abstract description of a design problem and how a general arrangement of elements (classes and object) solves it.
- Consequences - the results and trade-offs of applying the pattern. Critical in evaluating design alternatives and understanding the costs and benefits of applying the pattern.
Subscribe to:
Comments (Atom)
