Advantages
(+)
-
Enables abstractions at the
finest levels.
-
A small number of
physically created objects can
represent an open-ended number of
logically different objects.
Disadvantages
(–)
-
Introduces run-time costs.
-
Clients are responsible for passing in
extrinsic state dynamically at run-time.
-
Storing/retrieving/calculating extrinsic state
each time a flyweight operation is performed
can impact memory usage and
system performance.
-
Provides no reliability on object identity.
-
The same physically created object
represents many logically different objects.
-
Therefore, applications that depend on object identity
should not use flyweights.