mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-14 08:18:23 +00:00
Update README.md
This commit is contained in:
1 parent
9e85292f31
commit
074725c726
1 file changed
+6
@@ -77,6 +77,12 @@
|
|||||||
##Composite
|
##Composite
|
||||||
**Intent:** Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
|
**Intent:** Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Applicability:** Use the Composite pattern when
|
||||||
|
* 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. Clients will treat all objects in the composite structure uniformly
|
||||||
|
|
||||||
##Decorator
|
##Decorator
|
||||||
**Intent:** Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
|
**Intent:** Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user