From 67bc22c4ff8b368a7971b9cc5b564d5a7428587e Mon Sep 17 00:00:00 2001 From: Jakub Vojvoda Date: Fri, 16 Sep 2016 12:38:06 +0200 Subject: [PATCH] update READMEs --- README.md | 6 +++--- facade/README.md | 11 +++++++++++ flyweight/README.md | 12 ++++++++++++ proxy/README.md | 7 +++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 facade/README.md create mode 100644 flyweight/README.md create mode 100644 proxy/README.md diff --git a/README.md b/README.md index 9d8a071..98cb824 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ objects). - [Bridge], implementation of an object - [Composite], structure and composition of an object - [Decorator], responsibilities of an object without subclassing - - [Façade], todo - - [Flyweight], todo - - [Proxy], todo + - [Façade], interface to a subsystem + - [Flyweight], storage costs of objects + - [Proxy], how an object is accessed (its location) - Behavioral Patterns - [Chain of Responsibility], todo - [Command], todo diff --git a/facade/README.md b/facade/README.md new file mode 100644 index 0000000..904e2a1 --- /dev/null +++ b/facade/README.md @@ -0,0 +1,11 @@ +## Façade + +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. + +### When to use + +* you want to provide a simple interface to a complex subsystem +* there are many dependencies between clients and the implementation classes of an abstraction +* you want to layer your subsystems, use a facade to define an entry point to each subsystem level + \ No newline at end of file diff --git a/flyweight/README.md b/flyweight/README.md new file mode 100644 index 0000000..da65bf9 --- /dev/null +++ b/flyweight/README.md @@ -0,0 +1,12 @@ +## Flyweight + +Use sharing to support large numbers of fine-grained objects efficiently. + +### When to use + +* when all of the following are true + * an application uses a large number of objects + * storage costs are high because of the sheer quantity of objects + * most object state can be made extrinsic + * many groups of objects may be replaced by relatively few shared objects once extrinsic state is removed + * the application doesn't depend on object identity \ No newline at end of file diff --git a/proxy/README.md b/proxy/README.md new file mode 100644 index 0000000..ba536cf --- /dev/null +++ b/proxy/README.md @@ -0,0 +1,7 @@ +## Proxy + +Provide a surrogate or placeholder for another object to control access to it. + +### When to use + +* whenever there is a need for a more versatile or sophisticated reference to an object than a simple pointer