• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer
  • Core Java
  • Design Patterns
  • JSP
  • Servlets
  • Building Tools
  • jQuery
  • Spring
  • Hibernate
  • Mongo DB
  • More
    • HTML
    • SCJP
    • AJAX
    • UML
    • Struts
    • J2EE
    • Testing
    • Angular JS

J2EE Reference

  • Home
  • About Us
    • Java Learning Centers
  • Contact Us

GOF Design Patterns

July 7, 2017 By j2eereference Leave a Comment

According to the Design Pattern book titled “Design Patterns: Elements of Reusable Object-Oriented Software”, there are altogether twenty-three design patterns. This book was written and published by four authors namely John Vlissides, Erich Gamma, Ralph Johnson, and Richard Helm. These four authors who hold the fundamental responsibility of introducing Design Patterns in the field of software programming are termed as “Gang of Four” authors, in short as GOF.

As per these authors, the GOF Design Patterns are classified into three different categories namely:

  • Creational Design Patterns
  • Structural Design Patterns
  • Behavioral Design Patterns

Through this article, we will learn about the above mentioned categories in detail.

Creational Design Patterns:

Creational Design Pattern provides a methodology for creating objects by hiding the logic of object creation. Creational Design Pattern talks about “when should the objects be created?” and “How should the objects be created?”.

Types of Creational Design Patterns:

Among the 23 GOF Design Patterns, 5 design patterns fall under the category of “Creational Design Patterns”. They are:

  1. Factory Pattern: To create an object of numerous derived classes.
  2. Abstract Factory Pattern: To create an object of numerous families of classes.
  3. Builder Pattern: To separate object construction and object representation.
  4. Prototype Pattern: To copy or clone a fully initialized object.
  5. Singleton Pattern: To create only one object / instance for a particular class.

Structural Design Patterns:

Structural Design Pattern is concerned about composition of class and composition of object.

 Types of Structural Design Patterns:

Among the 23 GOF Design Patterns, 7 design patterns fall under the category of “Structural Design Patterns”. They are:

  1. Adapter Pattern –To match the interfaces of diverse classes.
  2. Bridge Pattern – To separate interface of an object from the implementation of that object.
  3. Composite Pattern – To create a tree structure encompassing simple objects and composite objects.
  4. Decorator Pattern – To dynamically add objects with their responsibilities.
  5. Façade Pattern – To use a single class to represent a whole subsystem.
  6. Flyweight Pattern –To efficiently share instance that is fine-grained.
  7. Proxy Pattern – To demonstrate an object that represents another object.

Behavioral Design Patterns:

Behavioral Design Patterns are concerned about object communication.

Types of Behavioral Design Patterns:

Among the 23 GOF Design Patterns, 11 design patterns fall under the category of “Structural Design Patterns”. They are:

  1. Chain of Responsibility Pattern – To pass a request through a chain of objects.
  2. Command Pattern – To encapsulate command request by way of an object.
  3. Interpreter Pattern – To incorporate language elements within a program.
  4. Iterator Pattern – To sequentially access collection elements.
  5. Mediator Pattern – To define simplified communication among classes.
  6. Memento Pattern – To capture and to restore the internal state of an object.
  7. Observer Pattern – To notify change to several classes.
  8. State Pattern – To alter the behavior of an object when there is an associated state change.
  9. Strategy Pattern – To encapsulate an algorithm within a class.
  10. Template Method Pattern – To defer the actual algorithmic steps to a subclass.
  11. Visitor Pattern – To define a new operation for a class without changing it.

 

 

Related Posts

  • Iterator Design Pattern Implementation using Java
  • Strategy Design Pattern Implementation using Java
  • Decorator Design Pattern
  • Adapter Design Pattern Implementation using Java
  • History and Need for Design Patterns
  • Command Design Pattern
  • Template Design Pattern
  • Proxy design pattern
  • Singleton in Clustered Environment
  • Observer pattern

Filed Under: Design Patterns

Reader Interactions

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

FOLLOW US ONLINE

  • View J2eereference-166104970118637’s profile on Facebook
  • View j2eereference’s profile on Twitter
  • View j2eereference’s profile on LinkedIn

Subscribe by email

Recent posts

  • Java Buzzwords
  • Anonymous Inner Class in Java
  • Network Programming – java.net Package
  • Java Regular Expressions
  • Method Local Inner Class in Java
  • URL Processing in Java
  • Iterator Design Pattern Implementation using Java
  • Strategy Design Pattern Implementation using Java
  • Decorator Design Pattern
  • Adapter Design Pattern Implementation using Java
  • JSF Composite Components
  • JSF UI Components
  • What is JavaServer Faces (JSF)?
  • GOF Design Patterns
  • History and Need for Design Patterns

Footer

Core Java
Design Patterns
JSP
Servlets
HTML
Building Tools
AJAX
SCJP
jQuery
Testing
Spring
UML
Struts
Java Centers
Java Training
Home
About Us
Contact Us
Copyright © j2eereference.com. All right reserved.