Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why grouping Design pattern in three parts?

Design pattern can separate 3 important parts. Why three part?

  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns

How can I separate it into three parts? According to what?

like image 760
ALEXALEXIYEV Avatar asked Feb 26 '23 21:02

ALEXALEXIYEV


2 Answers

Suggest you get a copy of the Gang of Four book that introduced (and explains) this classification.

like image 149
David M Avatar answered Mar 01 '23 23:03

David M


+1 to get Gang of Four.

Also bear in mind that these are basic classic patterns. And the division is done based on how and for what patterns can be used. Like you can see description in Wikipedia.

Creational patterns patterns have to do with class instantiation. They can be further divided into class-creation patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation to get the job done.

Structural patterns concern class and object composition. They use inheritance to compose interfaces and define ways to compose objects to obtain new functionality.

Behavioral patterns Most of these design patterns are specifically concerned with communication between objects.

You can also have Concurrency pattern, Enterprise Integration Patterns, Distributed design patterns, etc...

like image 34
Incognito Avatar answered Mar 01 '23 23:03

Incognito