/Behavioral-Design-Patterns-Java

This is a reference project to Structural Design Patterns.

Primary LanguageJava

Behavioral-Design-Patterns-Java

This is a reference project to Behavioral Design Patterns.

Patterns added :

Chain of Responsibility design pattern

  • Returns same instance
  • One constructor method - no args
  • Typically No Interface

Strategy design pattern

  • Guarantees Algorithm adherence
  • IoC
  • Easier implementation

Command design pattern

  • Object per command
  • Class contains the "what"
  • Encapsulates action

Interpreter

  • Access to properties
  • Function as methods
  • Adding new functionality changes every variant

Iterator

  • Interface based
  • Algorithm is removed
  • No index
  • Concurrent modification

Memento

  • State captured
  • Independent state
  • Caretaker/History

Observer

  • One-to-Many
  • Decoupled
  • Broadcast Communication

Template

  • same algorithm
  • Class based
  • Compile time

Visitor

  • Interfaced based
  • Externalized changes
  • Multiple visitors