Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 797 Bytes

README.md

File metadata and controls

24 lines (22 loc) · 797 Bytes

design-patterns

Implementation of different design patterns used in object oriented world

Creational

  • Singleton

    Real world example -> LogManager, Database connections,Config files and java.lang.Runtime#getRuntime()
  • Builder

    Real world example -> StringBuilder, javax.json.JsonBuilder,Custom SqlQueryBuilder
  • Prototype

    Usage - Scenario where creation of new objects is costly.
  • Factory

    Real world example ->java.util.Calendar#getInstance()
  • Abstract factory

    Real world example -> javax.xml.parsers.DocumentBuilderFactory#newInstance()

Structural

  • Adaptor

    Real world example -> Making Arrays compatible with Lists, Streams API compatible with other Java streams
  • Bridge

  • Composite

  • Decorator