Mediator Design Pattern

In object oriented programming, we have lots of objects interacting with each other. As project continues more objects are introduced and the interaction between these objects becomes dependencies between each other. We modify one object and we have to modify another object too because of dependency with each other. Mediator design pattern provides easy interaction …

Mediator Design Pattern Read More

Introduction to Design Patterns

Design patterns is an essential concept in software engineering. Every developer should know about Design patterns and how to apply these patterns in your project. Design Patterns are solutions to some common software design problems. These problems are the recurring design problems that software developers often faced during the development. Design patterns …

Introduction to Design Patterns Read More

Visitor Design Pattern

Visitor design pattern allows you to add new behaviors to an existing object without changing the object structure. Visitor pattern separates the non-related behaviors from the object and put them into a separate object. Visitor pattern creates a separate object for each new functionality. This pattern supports both single responsibility and open/closed SOLID principles. By …

Visitor Design Pattern Read More

Flyweight Design Pattern

Flyweight design pattern supports sharing of objects. In project, sometimes we have similar kinds of objects. Each object have two types of data. Intrinsic: This data is unique in all objects. Extrinsic: This data is common in all objects. Flyweight pattern gives you a pattern to design these objects lightweight by sharing the …

Flyweight Design Pattern Read More

Strategy Design Pattern

Strategy design pattern provides a family of algorithms. Each algorithm implements a single interface and all the algorithms are interchangeable. Client use the interface of the algorithm and can change the algorithm at runtime. Strategy pattern provides loosely coupling between the client and the algorithms. Structure Participants IStrategy: Defines an algorithm …

Strategy Design Pattern Read More

Memento Design Pattern

Memento design pattern provides the ability to store and restore object’s internal state without breaking encapsulation. This pattern is useful when we have to support undo or redo operations over an object. In OOPS, every object has internal state. To support undo/redo operations, we must save the state to somewhere. But due to encapsulation, object …

Memento Design Pattern Read More

Command Design Pattern

Command design pattern revolves around a single object which encapsulate all the information to execute a method at later time. This command object contains a receiver object instance and a method pointer. A client can use command object with different parameters. Command object uses client parameters and execute the method on the receiver object. Command design pattern is …

Command Design Pattern Read More