/DesignPatterns

A collection of commonly used design patterns in Java.

Primary LanguageJava

DesignPatterns

A collection of commonly used design patterns in Java.

Creational Patterns

  1. Singleton

Usecases:

When only one class must be created thoughout the application life cycle.

  1. Builder

Usecases:

When object to be created have multiple attributes and many of them are optional.

  1. Factory

Usecases:

When a generic creation method is needed for instances of classes having common attributes or behaviour.

Structural Patterns

  1. Adaptor
  2. Flyweight
  3. Decorator

Behavioural Patterns

  1. Strategy