A software design pattern, in the context of software engineering, is a general, reusable solution to a commonly occurring problem within a given context in software design.
Design patterns became popular after the publication of the book “Design patterns” (1995), written by four authors known as the Gang of Four (GoF).
List of Software Design Patterns
A full list of most common software design patterns can be found on this link.
Main categories for software design patterns:
- Creational
- Structural
- Behavioral
Creational controls how objects are created, composed, and represented.
Structural are concerned with how classes and objects are composed to form larger structures.
Behavioural are focused on communication between classes.
Creational
Creational patterns:
- Singleton
- Builder
- Abstract factory
- Prototype
Builder
Abstract factory
Abstract factory is sometimes refered just as factory. It creates objects without specifying the exact class.
It was one of the original desgin patterns of the Gang of Four.
Structural
Structural patterns
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
- Dependency Injection
Dependency Injection
Dependency injection (DI) decouples object creation from usage.
It means that the object or function that uses an object is different from the object or function that creates the object.
It did not appear among the original design patterns of the GoF.
It is part of a broader set of Inversion of Controls (IoC) patterns.
Dependency injection at Wikipedia
Behavioral
Behavioral patterns:
- Visitor
- Chain of responsibility
- Command
- Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template method
Strategy
Strategy pattern allows to have different methods or algorithms and decide it on execution time.
You might also be interested in…
External references
- Wikipedia; “Software design patterns“; Wikipedia