Home
Software Design Patterns Basics
Questions and Answers
Q: What are Design Patterns?
A: Patterns are devices that allow programs to share knowledge about their design. In our daily programming, we encounter many problems that have occured, and will occur again. The question we must ask ourself is how we are going to solve it this time. Documenting patterns is one way that you can reuse and possibly share the infomation that you have learned about how it is best to solve a specific program design problem. In software engineering, a design pattern is a general repeatable solution to a commonly-occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code; it is a description or template for how to solve a problem that can be used in many different situations.
Brief History of Design Patterns
The origin of design patterns lies in work done by an architect named Christopher Alexander during the late 1970s. He began by writing two books, A Pattern Language[Alex77] and A Timeless Way of Building [Alex79] which, in addition to giving examples, described his rationalle for documenting patterns. The pattern movement became very quiet until 1987 when patterns appeared again at an OOPSLA conference. Since then, many papers and presentations have appeared, authored by people such as Grady Booch, Richard Helm, and Erich Gamma, and Kent Beck. From then until 1995, many periodicals, featured articles directly or indirectly relating to patterns. In 1995, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides published Design Patterns: Elements of Reusable Object-Oriented Software [Gamma95], which has been followed by more articles in trade journals and additional books.
Types of Design Patterns
Creational Patterns
Abstract Factory:Creates an instance of several families of classes
Builder:Separates object construction from its representation
Factory Method:Creates an instance of several derived classes
Prototype:A fully initialized instance to be copied or cloned
Singleton:A class of which only a single instance can exist

Structural Patterns
Adapter:Match interfaces of different classes
Bridge:Separates an object’s interface from its implementation
Composite:A tree structure of simple and composite objects
Decorator:Add responsibilities to objects dynamically
Facade:A single class that represents an entire subsystem
Flyweight:A fine-grained instance used for efficient sharing
Proxy:An object representing another object

Behavioral Patterns
Chain of Responsibility:A way of passing a request between a chain of objects
Command:Encapsulate a command request as an object
Interpreter:A way to include language elements in a program
Iterator:Sequentially access the elements of a collection
Mediator:Defines simplified communication between classes
Memento:Capture and restore an object's internal state
Observer:A way of notifying change to a number of classes
State:Alter an object's behavior when its state changes
Strategy:Encapsulates an algorithm inside a class
Template Method:Defer the exact steps of an algorithm to a subclass
Visitor:Defines a new operation to a class without change
OneInfoPlace server is currently busy. Please try later. Sorry for the inconvenience
Comments/Feedback: Please login to participate