- 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
Intent
Also Known As
Motivation
Applicability
Structure
Participants
Collaborations
Consequences
Implementation
Sample Code
Known Uses
Related Patterns
Model/View/Controller (MVC)
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.
Thursday, February 21, 2008
Discusson of Software Engineering
http://en.wikipedia.org/wiki/Anti-pattern
Curt:
- Engineering can only be as good as its relationship with management
- Big design up front is foolish
- Software has much in common with other engineering disciplines
- Reliable systems are built by rigorously tested, incremental bottom-up engineering with an 'attitude of highest quality'
Danny:
If it is anything that I have found, it is that a purist approach in any discipline is probably wrong.
Full up design up front is too rigid for software, true. But, complete bottom up, focuses too much on details and too litle on direction. Both can turn out disasters.
Robert:
From Steve McConnell’s Code Complete:
“In the final analysis, top-down and bottom-up design aren’t competing strategies–they’re mutually beneficial. Design is a heuristic process, which means that no solution is guaranteed to work every time. Design contains elements of trial and error. Try a variety of approaches until you find the one that works well.”
Me:
Perhaps we should be looking for Anti-patterns like ‘Golden hammer’ and ‘Silver bullet’?
(See http://en.wikipedia.org/wiki
