Design Patterns Tutorial
A tutorial on GOF design patterns. This tutorial is for beginners who are going to learn design patterns for the first time. Each pattern is expalined with suitable examples.

15/11/2013 Categories: Introduction. No Comments on Catalog of design patterns

The catalog of GOF (Gang-of-Four) patterns contains 23 design patterns. They are listed below:

 

Abstract Factory:

Provides an interface for creating families of related or dependent objects without specifying their concrete classes.

 

Adapter:

Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.

 

Bridge:

Decouple (separate) the abstraction from its implementation so that the two can vary independently.

 

Builder:

Separate (hide) the construction process from its representation so that the same construction process can create different representations.

 

Chain of Responsibility:

Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

 

Command:

Encapsulate a request as an object which allows us to parametrize the clients with different requests and support undoable operations.

 

Composite:

Combine objects into tree structures to form 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 sub classing for extending functionality.

 

Façade:

Provide a uniform interface for a set of interfaces in a subsystem. Façade defines a higher level interface to make the subsystem easier to use.

 

Factory Method:

Defines an interface to create an object, but lets subclasses decide which class to instantiate. Factory Method lets a class differ instantiation to subclasses.

 

Flyweight:

Use sharing to support large numbers of fine-grained objects efficiently.

 

Interpreter:

Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

 

Iterator:

Provides a way to access the individual elements of an aggregate object without exposing its underlying representation.

 

Mediator:

Define an object that encapsulates how a set of objects interact.

 

Memento:

Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.

 

Observer:

Defines a one-to-many dependency between objects so that if one object changes its state, it will notify the change to all other objects and update automatically.

 

Prototype:

Specifies the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

 

Proxy:

Provide a placeholder for another object to control access to it.

 

Singleton:

Ensure a class has only one object and a global point of access to that object.

 

State:

Allow an object to change its behavior when its internal state changes. The object will appear to change its class.

 

Strategy:

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

 

Template Method:

Define the skeleton of an algorithm in an operation, deferring some steps to sub classes.

 

Visitor:

Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

Suryateja Pericherla

Suryateja Pericherla

Hello, I am Suryateja Pericherla working as an Asst. Professor in CSE department at Vishnu Institute of Technology. I write articles to share my knowledge and make people knowledgeable regarding certain topics.
Suryateja Pericherla

Latest posts by Suryateja Pericherla (see all)

Related Links:

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.
Scroll Up