Category Archives: Design Patterns

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 »