Design Pattern - (Decorator|wrapper)


The decorator pattern, also known as a wrapper allows you to extend the run-time behaviour of an object. This process is known as decorating.

A (wrapper|decorator) class is any class which “wraps” or “encapsulates” the functionality of another class or component.

They have several advantages:

  • Protection against the change of code
  • Simplification of code


A wrapper has generally a wrapper interface that permits to unwrap (to get the wrapped object). Example: java/sql/Wrapper

Documentation / Reference

Powered by ComboStrap