• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Design Patterns | Decorator
  1. References
  2. Example
    • The Component
    • The Concrete Component
    • The Decorator
    • The Concrete Decorator
    • A simple class to test the Decorator design pattern

  1. References
    • Definition: (source: http://en.wikipedia.org/wiki/Decorator_pattern)

      The decorator pattern can be used to extend (decorate) the functionality of a certain object statically, or in some cases at run-time, independently of other instances of the same class, provided some groundwork is done at design time.

    • Class diagram: (source: http://en.wikipedia.org/wiki/Decorator_pattern)

      Decorator Pattern
  2. Example
    • The Component:


    • The Concrete Component:


    • The Decorator:


    • The Concrete Decorator:


    • A simple class to test the Decorator design pattern:


© 2025  mtitek