Facade Design Pattern

Facade Pattern: A single class that represents the entire system. It is needed when one simple action needs many other action behind the scenes.


Example: A withdrawal from bank includes following actions

  1. Check if account is valid
  2. Check if Pin is valid
  3. Check if Amount is sufficient
  4. Make changes accordingly

Continue reading “Facade Design Pattern”

Prototype Design Pattern

Prototype Design Pattern: This pattern is used when objects or instances are created by cloning other object or instances. It allows to add any sub class instance of known super class instance. It is used when there are numerous potential classes , that are ready to use when needed.

It falls under creational design pattern. Continue reading “Prototype Design Pattern”

Azure Elastic Pool and Elastic Job

What is Elastic Pool: As the name suggests it is a pool of SqlAzure Dbs.

  1. Each elastic pool contains sets to SqlAzure dbs.
  2. Elastic pool has shared capacity among SqlAzure dbs.
  3. Elastic pool ensures best use of capacity and resource.
  4. It is very much cost effective also.
  5. Best option for dealing with unexpected db load at same time remaining cost effective.
  6. While creating elastic pool, Azure provides suggestion about which db to include in the pool and about min mac DTU, bases on DTU usages of Dbs.

Example: Let’s assume you have 10 basic SqlAzure dbs, which normally use 5 DTUs. During setup in Azure you assign each Db 10 DTU (considering scaling\peak) i.e total 100 DTU while most often consumption is 50 DTUs on average. So, you are paying for 50 DTU extra i.e double.

By putting then in elastic pool and setting the max DTU at a level (for ex: 60), you can handle unexpected db load and achieve cost effective solution.

P.S: In the above example, there is an assumption that all dbs don’t achieve peak at the same time.
Continue reading “Azure Elastic Pool and Elastic Job”

Chain of Responsibility Pattern

Chain of Responsibility Pattern: chain-of-responsibility pattern is a design pattern consisting of a source of command objects and a series of processing objects.

In other words, when a request can be handled by giving more than one object a chance to handle the request. Continue reading “Chain of Responsibility Pattern”

Singleton Pattern

Singleton Pattern: This pattern is used you want to eliminate the option of instantiating more than one object. It means one and only one instance of the class can be instantiated.

In other words, Singleton pattern is used when, A single instance of a class is required in the application and the class itself is able to enforce the single instance on itself. The rest of the system need not worry about managing the single instance. Continue reading “Singleton Pattern”

Factory and Abstract Factory Pattern

Factory Pattern: When a method returns instance one of several possible classes on runtime, bases on input parameters. All these classes must share a common super class.

Factoy Pattern falls under Creational Design Pattern. Continue reading “Factory and Abstract Factory Pattern”

Design Patterns and Gang of Four

Design Pattern: As the name suggests, design patterns are set of patterns used in software design, which provide solution to a commonly occurring problem. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

In other words, Design patterns are structured approach to computer programming and its architecture.

Patterns are about reusable designs and interactions of objects.

Gang of Four: The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral (for a complete list see below). Continue reading “Design Patterns and Gang of Four”

TDD, Unit Tests and Mocking

TDD: Test driven development is a development approach where direction of development is driven by tests. As the name suggests, in TDD, first piece of code to written is test case, then actual piece of code.

Unit Test: Unit test is a programming method to writes test cases for your application. Unit testing is used to break down the functionality of your program to a discrete testable piece. Unit test are also important to create a code coverage report. Thru Unit test, the code and logic written becomes testable and thus reliable. Continue reading “TDD, Unit Tests and Mocking”

C# From Beginning till 6.0

What is C#: C# is an Object-Oriented language

Evolution of C#: Following image shows the journey of C# till 6.0


C# 6.0 new features:

  • Auto-Property Initializer: As name suggests, it allows developer to set the value of the property when it is declared in class. Earlier, one need to set value in the constructor

public class Blog


        public string Name {get; set;}

        public Blog ()


            Name = “Name”;



But in C# 6.0 this can be like this

public class Blog


          public string Name {ge; set;} = “Name”;


One can also set different accessor for ‘get, set’ properties Continue reading “C# From Beginning till 6.0”