Monostate Design Pattern explained with simple example

Monostate design pattern is a singleton design pattern variation in which a class will act like a singleton but this class will look like a normal class. This design pattern states that all data member of monostate classes are static but any number of instances can be created in the program.

Before going ahead have a look at Design pattern simplified version and Singleton design pattern.

(more…)
Monostate Design Pattern explained with simple example Read More

Singleton Design Pattern Explained With Simple Example: Creational Design Pattern Category

The singleton design pattern ensures that at any point of time a class has one and only one instance which can be accessed globally. This design pattern is useful in cases where exactly one instance is needed to co-ordinate between different modules of a software. Singleton design pattern can be used as a logger class or memory/thread pool classes for which only one instance of object is needed. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Singleton Design Pattern Explained With Simple Example: Creational Design Pattern Category Read More

Prototype Design Pattern Explained With Simple Example: Creational Design Pattern Category

The Prototype design pattern is used when the objects which needs to be created is of similar types and can be cloned to produce new objects. The main aim of this pattern is to minimize the required cost of creating new object. This design pattern declares an abstract base class which exposes pure virtual clone() member function which is called by the client to get the required object instead of calling “new”. The idea behind this design pattern is to create first object of all prototype classes by the usual method and then for other objects use clone method which will create the new objects by copying the prototype objects. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Prototype Design Pattern Explained With Simple Example: Creational Design Pattern Category Read More

Abstract Factory Design Pattern Explained With Simple Example: Creational Design Pattern Category

 

The Abstract Factory pattern serves encapsulation to a group of individual factories without exposing the concrete classes. In this model, a generic interface of an abstract factory class is used to create the required concrete object separating the details of implementation of objects from their usage and composition. This design pattern is widely used in GUI applications where similar kind of GUI components needs to be created. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Abstract Factory Design Pattern Explained With Simple Example: Creational Design Pattern Category Read More

Builder Design Pattern in C++: Creational Design Pattern

Builder design pattern is used to solve the problem where application contains complex objects which are made of similar kind of other objects. Sometimes to create a complex class objects increases the object constructor parameter combination which leads to large number of constructors. Instead of using several constructors, Builder pattern uses another object called “Builder” that receives all the initialization arguments and returns the final object. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)
Builder Design Pattern in C++: Creational Design Pattern Read More

OOPS Design Patterns Simplified Version

Design pattern describes solutions to a problem which arises while developing software for a specific condition. Design patterns are basically independent of any programming language. Lot of guys do the mistake of thinking it as an algorithm but its a common way to solve a generic problem which can be simple or complex.

Basically there are three different categories of design patterns depending on the problem they address:

  • Creational Patterns
  • Structural Patterns
  • Behavioural Patterns
(more…)
OOPS Design Patterns Simplified Version Read More