From 10216f2ec9fc90ee6020fb18cb71b1735affd6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 24 Aug 2014 19:17:45 +0300 Subject: [PATCH] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 1aaa186d6..5f49249f1 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,13 @@ ##Decorator **Intent:** Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/decorator/etc/decorator.jpg "Decorator") + +**Applicability:** Use Decorator +* to add responsibilities to individual objects dynamically and transparently, that is, without affecting other objects +* for responsibilities that can be withdrawn +* when extension by subclassing is impractical. Sometimes a large number of independent extensions are possible and would produce an explosion of sublasses to support every combination. Or a class definition may be hidden or otherwise unavailable for subclassing + ##Facade **Intent:** Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.