As always Sean does a good job explaining how the decorator pattern works with code snippets as well.
My favorite part is the explanation of why to use the decorator pattern instead of just a traditional inheritance model:
This would work, however it’s not very desirable. Eventually as you add more and more permutations, (Coffee w/ Espresso, Coffee w/ Espress and Whip cream, etc..) it would lead to a class explosion and you would have a new class for every new combination of ingredients someone could have for a cup of coffee. A better option would be if we could add or "decorate" the original cost and name with our added options. Enter the Decorator Pattern.
Check it out!