From 98ebf20b0802d052fa4ef699b668ead7b3f7a20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 24 Aug 2014 19:40:29 +0300 Subject: [PATCH] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 5f49249f1..fcb6aba6f 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,13 @@ ##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. +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/facade/etc/facade.jpg "Facade") + +**Applicability:** Use the Facade pattern when +* you want to provide a simple interface to a complex subsystem. Subsystems often get more complex as they evolve. Most patterns, when applied, result in more and smaller classes. This makes the subsystem more reusable and easier to customize, but is also becomes harder to use for clients that don't need to customize it. A facade can provide a simple default view of the subsystem that is good enough for most clients. Only clients needing more customizability will need to look beyond the facade. +* there are many dependencies between clients and the implementation classes of an abstraction. Introduce a facade to decouple the subsystem from clients and other subsystems, thereby promoting subsystem independence and portability. +* you want to layer your subsystems. Use a facade to define an entry point to each subsystem level. If subsystems are dependent, the you can simplify the dependencies between them by making them communicate with each other solely through their facades + ##Flyweight **Intent:** Use sharing to support large numbers of fine-grained objects efficiently.