## Curiously recurring template pattern (CRTP)

Background: It is recommended to refer Virtual Functions and Runtime Polymorphism as a prerequisite of this. Below is an example program to demonstrate run time… Read More »

## Iterator Pattern

Iterator Pattern is a relatively simple and frequently used design pattern. There are a lot of data structures/collections available in every language. Each collection must… Read More »

## Command Pattern

Like previous articles, let us take up a design problem to understand command pattern. Suppose you are building a home automation system. There is a programmable remote… Read More »

This pattern is easy to understand as the real world is full of adapters.   For example consider a USB to Ethernet adapter. We need this… Read More »

## Strategy Pattern | Set 2 (Implementation)

We have discussed a fighter example and introduced Strategy Pattern in set 1. Strategy Pattern | Set 1 (Introduction) In this post, we apply Strategy… Read More »

## Strategy Pattern | Set 1 (Introduction)

As always we will learn this pattern by defining a problem and using strategy pattern to solve it. Suppose we are building a game “Street… Read More »

## Decorator Pattern | Set 3 (Coding the Design)

We have discussed Pizza design problem and different naive approaches to solve it in set 1. We have also introduced Decorator pattern in Set 2.… Read More »

## The Decorator Pattern | Set 2 (Introduction and Design)

As we saw our previous designs using inheritance didn’t work out that well. In this article, decorator pattern is discussed for the design problem in… Read More »

## Decorator Pattern | Set 1 (Background)

To understand decorator pattern let us consider a scenario inspired from the book “Head First Design Pattern”.  Suppose we are building an application for a… Read More »

## Singleton Design Pattern | Implementation

Singleton Design Pattern | Introduction The singleton pattern is one of the simplest design patterns. Sometimes we need to have only one instance of our… Read More »

## Observer Pattern | Set 2 (Implementation)

We strongly recommend to refer below Set 1 before moving on to this post. Observer Pattern -Introduction In Set 1, we discussed below problem, a… Read More »

## Observer Pattern | Set 1 (Introduction)

Let us first consider the following scenario to understand observer pattern. Scenario: Suppose we are building a cricket app that notifies viewers about the information… Read More »

## Design Patterns | Set 2 (Factory Method)

Factory method is a creational design pattern, i.e., related to object creation. In Factory pattern, we create object without exposing the creation logic to client… Read More »

## Design Patterns | Set 1 (Introduction)

Design pattern provides a general reusable solution for the common problems occurs in software design. The patterns typically show relationships and interactions between classes or… Read More »