/design-patterns

Learning Design Patterns.

Primary LanguageJava

design-patterns

https://www.digitalocean.com/community/tutorials/java-design-patterns-example-tutorial https://www.javatpoint.com/design-patterns-in-java https://www.tutorialspoint.com/design_pattern/index.htm https://www.freecodecamp.org/news/the-basic-design-patterns-all-developers-need-to-know/

1. Creational:

These patterns are designed for class instantiation. They can be either class-creation patterns or object-creational patterns.

  • Singleton
    • Eager
    • Lazy
    • Thread safe
  • Factory
  • Builder ("construct a complex object from simple objects using step-by-step approach")

2. Structural:

These patterns are designed with regard to a class's structure and composition. The main goal of most of these patterns is to increase the functionality of the class(es) involved, without changing much of its composition.

  • Decorator (aka Wrapper)
  • Adapter (aka Wrapper)

3. Behavioral:

These patterns are designed depending on how one class communicates with others.

  • Command (aka Action, Transaction)
  • Observer (aka Dependents, Publish-Subscribe)
  • Strategy (aka Policy)