SWE : Design Pattern — Introduction

Part 1 of Design Pattern series

Pisit J.
Sum up As A Service
2 min readMar 4, 2021

--

What is Design Pattern ?

  • In software engineering, Design Pattern is a general repeatable solution to a common problem in software design.

Design Pattern isn’t a finished design that can be transformed directly into code.

It is a description or template for how to solve a problem that can be used in many different situations.

Benefits of Design Pattern

  • Design Pattern can speed up the development process by providing tested, proven development paradigms.
  • Effective software design requires considering issues that might become visible in development process.
  • In addition, Design Pattern allow developers to communicate using well-known names of common problems.
  • Design Pattern can be improved over time, making them more robust than ad-hoc designs.

Criticisms of Design Pattern

  • The overall complexity of the code maybe increases since each pattern requires creating multiple new classes.
  • There is the problem that occurs in many developers who have just familiarized themselves with Design Pattern:

Having learned about Design Pattern, they try to apply them everywhere, even in situations where simpler code would do just fine.

Types of Design Pattern

1. Creational Design Pattern

identify how to create objects.

  • Abstract Factory
  • Builder
  • Prototype
  • Singleton

2. Structural Design Pattern

identify a simple way to manage relationships between objects.

  • Adapter
  • Bridge
  • Composite
  • Decorator
  • Facade
  • Flyweight
  • Private Class Data
  • Proxy

3. Behavioral Design Pattern

identify common communication patterns between objects.

  • Chain of Responsibility
  • Command
  • Interpreter
  • Iterator
  • Mediator
  • Memento
  • Null Object
  • Observer
  • State
  • Strategy
  • Template Method
  • Visitor

--

--