Facade Design Pattern Explained With Simple Example: Structural Design Pattern Category

The Facade design pattern provides a simple interface to a complex code in order to make the product easier to understand and use. This design pattern reduces the dependency of client code on the implementation of internal objects and since most of the product code uses the facade to hide the complexity of the system, thus allows the flexibility in developing the system. In this pattern, a single wrapper class known as “Facade” is implemented which contains a set of objects required by client. For Design patterns basic explanation see (Design Patterns Simplified Version).

(more…)

Facade Design Pattern Explained With Simple Example: Structural Design Pattern Category Read More

Decorator Design Pattern Explained With Simple Example: Structural Design Pattern Category

The Decorator design pattern allows behavior addition to an object either statically or dynamically without affecting the core behavior of other objects from the same class. This design pattern allows us to change the behavior of any specific object which is achieved by a wrapper class to the original class known as Decorator class. The original class is divided into two parts, one is with the essential basic features of the original class while the other one is the decorator base class which implements the same interface as the original class but allows to create several concrete decorator class having their own additional methods. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Decorator Design Pattern Explained With Simple Example: Structural Design Pattern Category Read More

Composite Design Pattern Explained With Simple Example: Structural Design Pattern Category

The Composite design pattern solves the problem via partitioning the various modules of the product.This design pattern treats a combination of objects as if they are an instance of an object. This design pattern sets up a tree structure in which each element performs a specific task. In this pattern every element of a tree can be of composite type which can have child or elements below them or leaf element which can’t have any elements below them. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Composite Design Pattern Explained With Simple Example: Structural Design Pattern Category Read More

Adapter Design Pattern Explained With Simple Example: Structural Design Pattern Category

The Adapter design pattern converts the interface of a class into another interface which is expected by the client. This design pattern is mostly used to make already existing classes work with each other without modifying it’s implementation. This design pattern is useful in cases where an existing class does all the required stuff but uses a different interface which is different from the client interface. For Design patterns basic explanation see (Design Patterns Simplified Version)

(more…)

Adapter Design Pattern Explained With Simple Example: Structural Design Pattern Category 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