Skip to main content

Gang of Four Design Patterns


Gang of Four(GOF) Design Patterns are divided in to 3 categories.


Creational Design Patterns ( 5 Patterns )


AbstractFactory


Builder Method


Factory Method



Prototype



Singleton


Singleton pattern is used when there is only one instance of the object need to be created per JVM instance. This pattern is used internally by the Connection Pooling to create the objects only on demand.





Structural Design Patterns ( 7 Patterns )


Adapter



Bridge Pattern



Composite Pattern




Decorator Pattern




Facade




FlyWeight


FlyWeight Pattern is used when there are a large number of objects to be created, and they need to be created efficiently. This pattern is used by many frame works to create the objects using configuration.



Proxy




Behavioral Design Patterns ( 11 Patterns )



Chain Of Responsibility Pattern



Command



Interpreter



Iterator



Mediator



Memento

Memento is used internally by Text Editor Applications, where ctr+Z or cmd+Z operations are used to remember the snap shot of the data.


State


State Design Pattern is used where ever the Behavior of the System, as a result of change in the State.



Strategy


Strategy Pattern is used when there a set of Algorithms, and one needs to be chosen dynamically at run time.




Template


Visitor

Comments

Popular posts from this blog

Design Patterns using Java

According to Gang of Four(GOF) any software is classified in to one of the three categories. I read so many books about design patterns which provide a lot of information about Design Patterns in a language neutral way or related to a particular programming language. I am trying to complement the great books by providing the precise and concise information that is required in the day to day programming of a Java Developer. Any software can be classified into one of the three categories -Framework, Toolkit, Application. Framework - Framework defines a set of steps to create an application. Framework provides design reuse. Toolkit - Toolkit provides some utility functions to an existing application. Toolkit provides code reuse. Application - Application is some thing that is specific to the project, and is not useful outside the context of the current application. Gang of Four divided the Design Patterns in to 3 types based on their usage. There are 3 types of Gang of Fo