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