Design Pattern: Chain of Responsibility Pattern

Chain of Responsibility pattern forms a chain of objects that is responsible for handling a command/operation request. As the responsibility is distributed into one or more objects and a single object is not responsible for handling a request, so that ensures the decoupling of the request sender and processor. The request is sent to the chain of objects without specifying the handler. Which object will handle the request is not predefined, that is decided on-the-fly while processing.

Design Pattern: Prototype Pattern

Prototype pattern defines the process of cloning an existing object and creating a new object from that. When we want to simplify the creation process of an object and optimize the performance of object creation, we can clone an existing object and create a new one from that.

Design Pattern: Builder Pattern in Java

Builder pattern is used to hide the complexity of building complex objects from the client and also this pattern is responsible for building objects step-by-step. This article demonstrates Builder pattern implementations in Java.

Design Pattern: Builder Pattern

When we need to construct a complex object, then Builder Pattern comes into play. Builder Pattern will hide the complexity of the object construction from the user. Builder Pattern will allow the complex object to be built step-by-step.

Design Pattern: Bridge Pattern

Using Bridge we can decouple the implementation of UI Element and Color Schema, so the elements and colors will have a separate hierarchy. That way the implementation of the Elements and Color will be independent and the element color can be set dynamically.

Design Pattern: Composite Pattern in Java

Composite pattern is used to handle the operation of a bunch of classes (having the same interface), to operate the same function of all items a the same time. Using Composite pattern the client can ignore the difference between the Composition and Leaf classes, and can use the composition considering the same interface. This article demonstrates Composite pattern implementations in Java. Check the following examples.

Design Pattern: Composite Pattern

When there is a bunch of classes that are of the same type (implement the same interface), and we need to use them as composition (not as individual objects), we can use Composite pattern. Composite pattern helps to use the classes in a composition, so that the client can use the composition and individual classes can be tread in the same way.

Design Pattern: Strategy Pattern

When there is a group of similar algorithms and we need a pattern to decide among those patterns, then we can use Strategy pattern.