diff --git a/bridge/README.md b/bridge/README.md index 8a17558..f662ffc 100644 --- a/bridge/README.md +++ b/bridge/README.md @@ -1,7 +1,7 @@ ## Bridge -Decouple an abstraction from its implementation so that the two can -vary independently. +Decouple an abstraction from its implementation so that the two can vary independently. +Bridge pattern has structural purpose and applies to objects, so it deals with the composition of objects. ### When to use diff --git a/composite/README.md b/composite/README.md new file mode 100644 index 0000000..173f897 --- /dev/null +++ b/composite/README.md @@ -0,0 +1,10 @@ +## Composite + +Compose objects into tree structures to represent part-whole hierarchies. +Composite lets clients treat individual objects and compositions of objects uniformly. +The pattern has structural purpose and applies to objects. + +### When to use + +* you want to represent part-whole hierarchies of objects +* you want clients to be able to ignore the difference between compositions of objects and individual objects \ No newline at end of file diff --git a/decorator/README.md b/decorator/README.md new file mode 100644 index 0000000..33661d7 --- /dev/null +++ b/decorator/README.md @@ -0,0 +1,11 @@ +## Decorator + +Attach additional responsibilities to an object dynamically. Decorators +provide a flexible alternative to subclassing for extending functionality. +The pattern has structural purpose and applies to objects. + +### When to use + +* 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 \ No newline at end of file