Introduction to design patterns

in #patterns7 years ago

observer.png

In this lesson we will discuss what the design patterns, the types of design patterns are and in the next lesson I will talk about the first (Anti) pattern, singleton, personally, in most cases I do not recommend using it. Why not? We’ll get to that 🙂

What are design patterns?

There are many repetitive problems in the design of various information systems, these are usually repetitive problems, and design patterns have been created for these repetitive problems.

Due to the fact that specific design patterns have been created for specific problems, if we use a design pattern in the wrong way, it may end in a tragedy for us, it must be remembered that a design patern aren’t a problem, problem is wrong using and incomprehension.

Therefore, when in the introduction I said that Singleton is not recommended for use in most cases, among others because it breaks the principles of SOLID, Single responsibility (SRP) and Open-closed (OCP) and is stiff, not flexible and makes testing is difficult, but in some cases is a useful pattern. In the next lesson, I will describe Singleton in more detail.

Types of design patterns

1. Creational design patterns

They allow to separate the process of creating object instances from their definitions:

  1. Builder
  2. Abstract Factory
  3. Factory Method
  4. Prototype
  5. Singleton
  6. Object pool

2. Structural design patterns

Patterns regarding problems with relations between many classes, solve typical problems of systems that have many classes, for example, so that binding between class are not too strong or not to use too much CPU resources:

  1. Adapter
  2. Decorator
  3. Facade
  4. Composite
  5. Bridge
  6. Proxy
  7. Flyweight

3. Behavioral design patterns

They are responsible for sharing responsibility between classes, if someone knows the principles of Solid, in particular the first one will understand what’s going on.

  1. Interpreter
  2. Iterator
  3. Chain of responsibility
  4. Mediator
  5. Template Method
  6. Observer
  7. Visitor
  8. Memento
  9. Command
  10. State
  11. Strategy

And that would be enough of these more important design patterns, I will try to describe them all, there are also architectonic patterns such as MVC or MVVM, and design patterns for concurrent applications. I will try to describe them all in the next lessons on practical examples.

This content also you can find on my blog http://devman.pl/programtech/introduction-design-patterns/

If you recognise it as useful, share it with others so that others can also use it.

Leave upvote and follow and wait for next articles :) .

And that’s it when it comes to theories about design patterns, in the next lesson we will discuss Singleton.

Sort:  

WARNING - The message you received from @turnkeyshop is a CONFIRMED SCAM!
DO NOT FOLLOW any instruction and DO NOT CLICK on any link in the comment!
For more information, read this post: https://steemit.com/steemit/@arcange/phishing-site-reported-autosteemer-dot-com