A Behavioral Design pattern Visitor design pattern is a way of separating an operational logic or algorithm from an object structure on which it operates. Visitor lets you define new operations to existing object structures without modifying the structures. It provides good use of the Open/Closed principle as we won’t modify the code, but we’ll still
Tag: JavaDesignPatterns
Bridge Design Pattern
A Structural Design pattern Let’s start with the concrete definition, directly from the GoF book, Design Patterns. “Decouples an abstraction from its implementation so that the two can vary independently.” It states bridge pattern decouples the abstract elements of a class from its implementation by providing a bridge structure between them. Both types of
Decorator Design Pattern
Decorator pattern is used to add additional responsibility/ functionality to existing behaviour of an object without altering its original structure. This pattern creates a decorator class which is wrapper to the existing class and provides additional functionality keeping class methods signature intact. The decorator pattern uses composition providing a flexible alternative to