Tag:

Behavioral Pattern

11 posts found

5/11/2022
3 min read

Interpreter Pattern: Defining a Grammar and Interpreting Language Rules

Some problems require you to evaluate or process sentences, expressions, or commands that follow a particular grammar or set of rules.

By Misbahul Munir

5/1/2022
3 min read

Visitor Pattern: Separating Operations from the Objects They Work On

Sometimes you want to **perform operations on objects of different types** without changing those object classes.

By Misbahul Munir

4/22/2022
4 min read

Template Method Pattern: Defining the Steps, Letting Subclasses Fill in the Details

Sometimes you have an **algorithm with a fixed structure**, but certain steps of the process need to be defined or customized by subclasses.

By Misbahul Munir

4/13/2022
3 min read

Iterator Pattern: Sequentially Accessing Elements Without Exposing the Structure

Sometimes you need to **traverse** a collection (like a list, tree, or database results) without exposing its underlying representation.

By Misbahul Munir

4/7/2022
3 min read

State Pattern: Changing Behavior When State Changes

In software, objects often behave differently depending on their current situation or **state**.

By Misbahul Munir

3/30/2022
3 min read

Memento Pattern: Saving and Restoring Object State

When building software, sometimes we need the ability to “travel back in time.” Whether it’s undoing the last user action, reverting a configuration change, or ...

By Misbahul Munir

3/25/2022
4 min read

Mediator Pattern: Centralizing Communication Between Components

In many backend systems, different modules or services need to talk to each other.

By Misbahul Munir

3/16/2022
4 min read

Chain of Responsibility Pattern: Passing the Request Along the Chain

Sometimes in backend systems, a request might have **multiple possible handlers**, and we don’t want the sender to know which one will actually process it.

By Misbahul Munir

3/11/2022
4 min read

Command Pattern: Turning Requests into Reusable Objects

In the world of backend systems, requests to perform actions are everywhere — from executing a database migration, to scheduling a background job, to triggering...

By Misbahul Munir

3/3/2022
5 min read

Observer Pattern: Keeping Everyone in the Loop

Welcome to the continuation of our **Design Pattern Series**. Having explored **Creational** and **Structural** patterns, we now dive into the **Behavioral** ca...

By Misbahul Munir

12/15/2021
3 min read

Strategy Pattern: Switching Algorithms at Runtime

So far in this series, we’ve explored the Singleton and Factory patterns—two of the most used creational patterns in backend development. In today’s post, we’re...

By Misbahul Munir