Tag Archives: Design Patterns

C# – Transient vs. Scoped vs. Singleton

By | 12/11/2025

In this post, we’ll see the three main service lifetimes in .NET: Transient, Scoped, and Singleton. We’ll also touch on the concept of Dependency Injection (DI) and provide C# code examples to illustrate how each lifetime works. WHAT IS DEPENDENCY INJECTION?Dependency Injection is a design pattern that allows us to remove hard-coded dependencies and make… Read More »

Design Patterns – CQRS

By | 01/10/2025

In this post, we will see what CQRS is and how we can use it in our projects.But first of all, what is CQRS?“Command Query Responsibility Segregation (CQRS) is an architectural pattern that challenges traditional monolithic approaches to data management. At its core, CQRS separates the read (Query Model) and write (Command Model) operations of… Read More »

Design Patterns – Adapter

By | 19/06/2024

In this post, we will see what the Adapter Pattern is and how we can implement it.But first of all, what is the Adapter Patterns?“The Adapter Design Pattern converts the interface of a class into another interface that a client expects. It allows classes to work together that couldn’t otherwise because of incompatible interfaces. The… Read More »

Minimal APIs – Clean Architecture

By | 05/06/2024

In this post, we will see how to implement Clean Architecture with .NET Core Minimal APIs, enabling us to build applications that are both efficient and easy to maintain.But first of all, what is the Clear Architecture?Clean Architecture, proposed by Robert C. Martin (Uncle Bob), is a design philosophy that emphasizes the separation of concerns… Read More »

Design Patterns – Asynchronous Factory

By | 13/03/2024

In this post, we will see how to use the Asynchronous Factory Method pattern in our project.But first of all, what is Asynchronous Factory Method and why should we use it?“In many applications, especially those that involve database operations, initializing data asynchronously during startup is a common requirement. However, constructors in C# do not support… Read More »

Design Patterns – Decorator

By | 11/10/2023

In this post, we will see what the Decorator Pattern is and how we can implement it.But first of all, what is the Decorator Patterns?From Wikipedia:“In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the… Read More »

C# – Big O notation

By | 08/02/2023

In this post, we will see what Big O notation is and how to use it to optimize our algorithms.But first of all, what is Big O notation?From Wikipedia:“Big O notation is a mathematical notation that describes the limiting behaviour of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann,… Read More »