Tags » Design Pattern

Unit of work Design pattern with Repository and Session

Prerequisites : Repository Pattern

What is Unit of work pattern and why is it needed ??

According to Martin Fowler : ‘It Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems’.  1,638 more words

C#

Memento design pattern: Part 1

Today, I will show you how to implements the Memento design pattern in Python. Assuming, that you are in a position where you want to implement an undo system. 282 more words

Python

Singleton Pattern

Singleton :

Make an instance of an object globally available and guarantee that only one instance of the class is created

 

using System;

public class Singleton
{
   private static Singleton instance;

   private Singleton() {}

   public static Singleton Instance
   {
      get 
      {
         if (instance == null)
         {
            instance = new Singleton();
         }
         return instance;
      }
   }
}
… 860 more words
Design Pattern

Facade Design Pattern

Introduction

There are situations in our application, where we have to work with an series of objects to perform certain task. For instance, If we are writing a program for universal remote and I need to turn off all the gadgets then I have few alternatives. 691 more words

C#

Inversion of Control – Best Practises

Always Create an Interface

Every class that defines operations must have an interface.  The interface should serve as a contract and is particularly useful when mocking the behaviour during unit testing. 574 more words

C#

Observer Design Pattern

Introduction

The observer design pattern enables a subscriber to register with and receive notifications from a provider. It is suitable for any situation that obliges push-based notification. 845 more words

C#