July 2010
Beginner to intermediate
404 pages
10h 6m
English
The decorator pattern allows us to "wrap" an object that provides core functionality with other objects that alter that functionality. Any object that uses the decorated object will interact with it in exactly the same way as if it were undecorated (that is, the interface of the decorated object is identical to the core object).
There are two primary uses of the decorator pattern:
The second option is often a suitable alternative to multiple inheritance. We can construct a core object, and then create a decorator around that core. Since the decorator object has the same interface as the core object, we can even ...
Read now
Unlock full access