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.



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. Examples of names include 1) factory method 2) singleton 3) mediator 4) prototype.
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. Examples of names include 1) factory method 2) singleton 3) mediator 4) prototype.

The problem the pattern solves includes a general intent and a more specific motivation or two. For instance, the intent of the singleton pattern is to prevent more than one instance of a class from being created.
The problem the pattern solves includes a general intent and a more specific motivation or two. For instance, the intent of the singleton pattern is to prevent more than one instance of a class from being created.


The solution to the problem specifies the elements that make up the pattern such as the specific classes, methods, interfaces, data structures and algorithms.
The solution to the problem specifies the elements that make up the pattern such as the specific classes, methods, interfaces, data structures and algorithms.

Often more than one pattern can solve a problem. Thus the determining factor is often the consequences of the pattern. Some patterns take up more space and some take up more time.
Often more than one pattern can solve a problem. Thus the determining factor is often the consequences of the pattern. Some patterns take up more space and some take up more time.