Design Pattern: Factory Pattern in Java

Factory pattern helps to generate object by choosing one class from a bunch of classes. The class is chosen by some predefined criteria. This article demonstrates Abstract Factory pattern implementations in Java.

Design Pattern: Strategy Pattern in Java

Strategy pattern is used when there are multiple algorithms available for the same purpose, and we need to decide between those algorithms. Strategy pattern helps to decide the algorithm and return the generated object to be used. This article demonstrates Strategy pattern implementations in Java. Check the following examples.

Design Pattern: Adapter Pattern in Java

Adapter pattern is used when an interface does not match the new requirement and the existing interface needs to adapt to another interface. This article demonstrates Adapter pattern implementations in Java.

Design Pattern: Facade Pattern in Java

Facade pattern is used to hide the complexity of underlying subsystems. A new layer is created as Facade, which works as an entry point for the client. This article demonstrates Facade pattern implementations in Java.

Design Pattern: Flyweight Pattern in Java

Flyweight pattern is used to reduce the number of objects to save memory and optimize resources. This article demonstrates Flyweight pattern implementations in Java. Check the following examples.

Design Pattern: Decorator Pattern in Java

Decorator pattern is used to attach a new functionality to an existing object, without changing the existing class. This article demonstrates Decorator pattern implementations in Java.

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.