The Essentials: Design Patterns

Essential Patterns to Know

In the new posts, I'll be focusing on some suggested design patterns and evaluating them based on the components described in the last post.

I will be covering:
  1. Abstract Factory (Creational)
  2. Adapter (Structural)
  3. Composite (Structural)
  4. Decorator (Structural)
  5. Factory Method (Creational)
  6. Observer (Behavioral)
  7. Strategy (Behavioral)
  8. Template Method (Behavioral)
The following design patterns have been organized into three categories: Creational, Structural, and Behavioral.  Additionally there are categorize them by the scope of the pattern, if it is on the class (structure) or the object (implementation).

Pattern Types

Creation Design Patterns deal with how you create objects.  Creational class patterns will defer object creation to subclasses, whereas Creational object patters defer it to another object.

Structural Design Patterns deal with the composition of classes and objects.  Structural class patterns use inheritance to compose classes, while structural object patterns describe how to assemble projects.

Behavioral Design Patterns characterize how classes or objects interact and distribute responsibilities.  Behavioral Class patterns use inheritance to describe algorithms and flow of control, while behavioral object pattern describes how a group of objects cooperate to perform a task.

While we defined these three categories of design pattern, that does not mean that a certain pattern does not have components of the other two patterns.  It just means that it focuses on a specific part of the pattern.  In real world programming, you will often find yourself combining various design patterns together to solve complex problems.

Comments

Popular posts from this blog

Uncle Bob's Clean Architecture

C4 Model: Describing Software Architecture

Running RabbitMQ with Docker