Category Archives: Design Patterns

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 »

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 »

Design Patterns – MVVM in SwiftUI

By | 14/07/2021

In this post, we will see how to implement MVVM pattern in SwiftUI.But, what is MVVM pattern?From wikipedia:“Model–view–viewmodel (MVVM) is a software architectural pattern that facilitates the separation of the development of the graphical user interface (the view) – be it via a markup language or GUI code – from the development of the business logic or back-end logic (the model) so that the view is not dependent on any… Read More »

Design Patterns – Command

By | 31/03/2021

From https://en.wikipedia.org/wiki/Command_pattern:“In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or trigger an event at a later time. This information includes the method name, the object that owns the method and values for the method parameters.”In a nutshell, we can use the Command Pattern to encapsulate… Read More »

Design Patterns – Singleton

By | 21/10/2020

From Wikipedia:“In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to one ‘single’ instance. This is useful when exactly one object is needed to coordinate actions across the system. The term comes from the mathematical concept of a singleton.“ In this post, we will see how to implement this pattern in a .NET Console application. We… Read More »

Design Patterns – Repository and Unit of Work

By | 03/12/2019

From Microsoft Web Site:“The repository and unit of work patterns are intended to create an abstraction layer between the data access layer and the business logic layer of an application. Implementing these patterns can help insulate your application from changes in the data store and can facilitate automated unit testing or test-driven development (TDD)“. In… Read More »

Design Patterns – Factory

By | 23/09/2019

From https://en.wikipedia.org/wiki/Factory_method_pattern:“In class-based programming, the factory method pattern is a  creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally… Read More »