GofPatterns Gofpatterns  





Design Patterns  «Prev 

Behavioral, Creational, Structural Types of Design Patterns

Based on the official Design Pattern Book, "Design Patterns: Elements of Reusable Object-Oriented Software", there are 23 design patterns. These patterns can be grouped into three categories:
  1. Creational,
  2. Structural and
  3. Behavioral patterns.
  4. In addition, we will discuss another category of design patterns: J2EE Design patterns.
  1. Creational Patterns: These design patterns provide ways to create objects while hiding the creation logic, instead of instantiating objects directly using the new operator. This gives the program more flexibility in deciding which objects need to be created for a given use case.
  2. Structural Patterns: These design patterns deal with class and object composition. The concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionality.
  3. Behavioral Patterns: These design patterns are specifically concerned with communication between objects.
  4. J2EE Patterns: These design patterns are specifically concerned with the presentation tier. These patterns were formerly identified by Sun Java now Oracle.

Name of the Pattern:

The name of the pattern is a one or two word description that pattern-literate programmers familiar with patterns can use to communicate with each other.
Examples of names include "factory method", "singleton", "mediator", "prototype". The name of the pattern should communicate to the programmer the problem it solves and the solution.
Design Patterns - Reusable SoftwareDesign Patterns - Reusable Software

What are the elements of a design pattern?

The name of the pattern is one or two word description that pattern-literate programmers familiar with patterns can use to communicate with each other.
The name of the pattern is one or two word descriptions that pattern-literate programmers familiar with patterns can use to communicate with each other.

The problem the pattern solves includes a general intent and a more specific motivation or two.
The problem the pattern solves includes a general intent and a more specific motivation or two.


The solution to the problem specifies the elements that make up the pattern such as the specific classes.
The solution to the problem specifies the elements that make up the pattern such as the specific classes.

Often more than one pattern can solve a problem. Thus the determining factor is often the consequences of the pattern.
Often more than one pattern can solve a problem. Thus the determining factor is often the consequences of the pattern.