1. Extend the shop example given earlier by adding more discount decorators and introducing
more qualii ers to gain i ner control over which decorators are invoked for which concrete
2. Implement the decorator pattern on an existing API to add new functionality.
For example: java.io.FileInputStream.
3. Create a decorator that adds behavior to a bank account system such that when the client
withdraws more than a certain amount of cash, an SMS text message is sent to the client
advising of the withdrawal.
1. Design Patterns: Elements of Reusable Object‐Oriented Software (Addison‐Wesley, 1994):
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides.
2. Head First Design Patterns (O'Reilly, 2004): Eric Freeman, Elisabeth Robson, Bert Bates,
3. Pyro: http://muse.com.tr/pyro.html.
CDI Specii cations 1.1: http://docs.jboss.org/cdi/spec/1.1/cdi‐spec