Photo by Brian Kyed on Unsplash

Design Patterns — overview

Daniel Jankowski
Netcompany
Published in
3 min readDec 13, 2019

--

Whenever I need to write some solution, I always ask myself, what is the vision?

Speaking as a builder, if you start something, you must have a vision of the thing which arises from your instinct about preserving and enhancing what is there.
Christopher Alexander

Very often this vision evolves over time, but everything has to start somewhere.

Topics I’ll cover

  • What is design pattern?
  • Who invented the design pattern?
  • Do I really need to apply Design Patterns?
  • Can Design Patterns be grouped?
  • Which one will be best for my project?
  • Summary

What is design pattern?

A proven, repeatable and universal solution for frequently recurring problems. It only describes a possible solution, not the exact implementation. Design patterns are, used in object-oriented programming.
A design pattern has always a purpose to improve existing something.
They are an abstract description of the relationship between classes.
We can combine several design patterns to better solve the problem.

Who invented the design pattern?

Christopher Alexander is the father of the Pattern Language movement in computer science, and A Pattern Language was perhaps the first complete book ever written in hypertext fashion.

Design Patterns were introduced into software engineering in 1995 by “Gangs of Four Design Patterns” — Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. They wrote the book known as the Bible of Design Patterns: “Design Pattern: Element of Reusable Object-Oriented Software”.

Do I really need to apply Design Patterns?

The short answer is: “Yes”!

  • These are the questions you should ask:
  • What Design Patterns works best for the size and complexity for my project?
  • Where are the patterns used?
  • Can patterns be grouped?

I will try to answer all these questions and much more.

Can Design Patterns be grouped?

The answer is: “Of course”.
I’ll describe each group in a separate article.

Division of design patterns:

Creational Patterns

Describe the process of creating new objects. Their tasks is to create and initialize classes, objects and other types of data.
There are several types:

  • Singelton
  • Abstract Factory
  • Prototype
  • Factory Method
  • Builder

Structural Patterns

Help to combine objects for larger structure.
There are few types:

  • Adapter/Wrapper
  • Bridge
  • Facade
  • Proxy

Behavioral Patterns

Describe how objects or classes interact and share responsibilities.
There are a few types:

  • Strategy
  • Dependency Injection
  • Observer

Which one will be best for my project?

Each of design patter is unique, but I wrote that you can and should combine them together. You should read about their exact definition and choose the best patterns for your project.

Summary

Complexity is one of the great problems in environmental design.
Christopher Alexander

I think the above sentence is very important in this matter. The more complex the project, the more it needs clarity and clear defined rules to be developed.

Design Patterns is something necessary and I use it on my day-to-day work as a programmer at Netcompany. In general, it helps developers to build robust systems that scale.

I invite you to read the other articles in this series:

You can follow/contact me through this link: Daniel Jankowski.
This article is the property of Netcompany.

Netcompany provides IT solutions for both large enterprises and governments

--

--