Decorator Design Pattern

Decorator Design Pattern

Decorator pattern is a structural design pattern that attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. So what exactly is that supposed to mean ?? Let us assume that our client is a travel company specializing in trips from the United States to Dubai. In addition … Read more

Builder Design Pattern

Builder pattern is a creational design pattern that builds a complex object step by step.It separates the construction of a complex object from its representation, so that the same construction process can create different representations. Confusing right ?? Let’s understand this with the help on an example.Suppose you have an object to create a user … Read more

Factory Design Pattern

The factory design pattern is a creational design pattern, that provides an interface for creating objects, but allows subclasses to alter the type of objects that will be created.Rather than calling a constructor directly to create an object, we use factory method to create that object based on some input or condition. I know…I know…didn’t … Read more

Singleton Design Pattern

Singleton Design Pattern is a creational design pattern which ensures that a class has only one instance and provides a global point of access to that instance. I know you might be thinking – “Why is there an entire design pattern just to make sure only one object is instantiated??” To tell you the truth, … Read more

Introduction To Design Patterns

Design Patterns are reusable templates or blueprints towards the solution of common problems in software design. When communicating with other developers using a pattern in description, others know exactly the design you have in mind, as by using the pattern name, you communicate the whole set of qualities, characteristics and constraints that the pattern represents. … Read more