1
edit
Changes
m
→Introduction
==Introduction==
Decorator, a [http://en.wikipedia.org/wiki/Structural_pattern structual pattern] also known as wrapper, adds additional functionality to a class at runtime through composition. Decorators are alternative to subclassing which add behaviour at compile time. By wrapping, it allows us to add things to the component without requireing requiring every subclass to inherit these new qualities. Each decorator class wraps a component, which means the decorator has an instance variable that holds a reference to a component.
==Motivation==