↓Skip to main content

Design Patterns

2023


Strategy Design Pattern

·4 mins

The Strategy design pattern helps to define different behaviors or functionalities that can be changed at runtime.

In the Strategy pattern, we create different classes that represent strategies and that we can use, according to some variation or input.

Singleton Design Pattern

·2 mins

This is one of the best-known patterns and is perhaps the first that comes to mind when you ask us about design patterns in Java.

The goal is to have only one instance of a class involved and ensure that this happens every time this instance is needed.

Observer Design Pattern

·4 mins

The Observer’s design pattern is used primarily when we are interested in any change of status being notified to anyone who needs to know about that change.

In the observer design pattern, the object that looks at the state of another object is called “Observer” and the object that is “looking” those changes is called “Subject”.

Factory Design Pattern

·3 mins

The Factory design pattern is mainly used when we have a class or interface with many subclasses or implementations, and according to some input, we need to return one of these specific subclasses.

Facade Design Pattern

·3 mins

The Facade design pattern simplifies the complexity of a system through a simpler interface.

It improves access to our system by allowing other systems or subsystems to use a common access point that reduces complexity, minimizing interactions and dependencies.