Design Pattern Evangelist Blog

Smart pointers about software design

Dems D’FFACTS

Seven essential design patterns that should be in every developer’s toolbox


Abstraction of Essential Design Patterns

Gang of Four Struggles

I struggled with the original Design Patterns book by the Gang of Four (GoF). The individual patterns are mostly presented in alphabetical order, which is fine for reference, but it didn’t work for me for learning the patterns. Several of the more complex and less frequently used patterns are near the beginning of the alphabet, and hence near the start of the book. Whereas some of the less complex and more frequently used patterns are near the end of the alphabet, and hence near the end of the book. I became overwhelmed by the complex ones, and I was unable to continue learning the design patterns via the book.

Dems D’FFACTS

Just the Facts Ma'am

I learned the design patterns via other online resources. Some of the design patterns are like hammers and screwdrivers in my toolbox. I use them in many of my designs. Other patterns, not so much. These less used tools are still great tools to have even if I don’t use them as often.

Everyone will have their own favorite set of design patterns, but here are the seven that I personally feel are essential to all developers. When I rattled off some of them in a Zoom call a few weeks ago, my friend Scott Harden blurted out FACTS as an acronym, which covered most of them. When I considered the entire list, I made a few adjustments, and here they are in this acronym order:

Seven Essential Design Patterns in Logical Order

While I love Scott’s acronym to help recall the set of essential design patterns, this is not the order in which I prefer to present them. Some of these design patterns are natural extensions of others. I will introduce them in what I consider logical order with highlights to their basic OO components:

Command

Strategy

Template Method

Adapter

Facade

FactoryMethod

Dependency Injection

Summary

Most of these patterns demonstrate Program to an interface, not an implementation in that most of them have an interface or abstract base class at the top of their diagrams.

Many of these patterns work well together. I think this is demonstrated best with Hexagonal Architecture, which is also known as Ports and Adapters.

Comments

Previous: Design Pattern Principles

Next: Command Design Pattern

Home: Design Pattern Evangelist Blog