Design Patterns – What, when, why?

Here is a brief introduction to Design Patterns.

Well, design patterns aren’t something new, but is something that won’t be unused and will be still important for a long time. Here I will try to explain what they are when you should use or not and why.

What are design patterns?

Design Patterns are elegant solutions to repeating problems, which means are basically reusable solutions in software to solve common problems in development.

The most important book about it was written by Gof and they divided these patterns in 3 categories:

Creational -> are about different ways to create objects.

Structural -> are about relationships between these objects.

Behavioral -> are about interaction or communication between these objects.


When?

Maybe the most important thing about Design Pattern is understanding when it should be used or when is necessary. In some cases just an if could solve your problem, I mean, you could apply unnecessary complexity to your code. I will show examples of this in my next posts. Also is more important to understand the concept behind each pattern than the diagram itself.

Another thing that some people maybe don’t agree with or understand is that design patterns are examples of re-usable solutions that work with some kind of problems and they are there to be based on and could be modified or improved.


Why?

1 . Because with Design Patterns you will be able to design reusable and extensible real object-oriented software.

2 . Design patterns help us solve complex problems of development.

3 . Helps you to communicate with your team using a more abstract level.

4 . Helps you to grow your codebase keeping it tidy.

5 . Helps you learn new frameworks.


last but not least

To continue is important that you have some knowledge in OOP and SOLID.

Now you have an idea of what are design patterns, we will start a project to work on. We will learn this awesome stuff together and lastly, some design patterns are almost equal, the difference between them could be just the Meaning/Purpose of the pattern.

We will use ❤ PHP for this project, but you could use any OO language to apply the concepts. #Freedom

Summary (Not in order of posts)

  • Behavioral
    • Design Patterns – Chain of Responsibility
    • Design Patterns – Command
    • Design Patterns – Interpreter
    • Design Patterns – Iterator
    • Design Patterns – Mediator
    • Design Patterns – Memento
    • Design Patterns – Observer
    • Design Patterns – State

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :