X Tutup
Skip to content

Commit 0b7892d

Browse files
committed
Update README.md
1 parent d63167b commit 0b7892d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@
106106
##Flyweight
107107
**Intent:** Use sharing to support large numbers of fine-grained objects efficiently.
108108

109+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/flyweight/etc/flyweight.jpg "Flyweight")
110+
111+
**Applicability:** The Flyweight pattern's effectiveness depends heavily on how and where it's used. Apply the Flyweight pattern when all of the following are true
112+
* an application uses a large number of objects
113+
* storage costs are high because of the sheer quantity of objects
114+
* most object state can be made extrinsic
115+
* many groups of objects may be replaced by relatively few shared objects once extrinsic state is removed
116+
* the application doesn't depend on object identity. Since flyweight objects may be shared, identity tests will return true for conceptually distinct objects.
117+
109118
##Proxy
110119
**Intent:** Provide a surrogate or placeholder for another object to control access to it.
111120

0 commit comments

Comments
 (0)
X Tutup