You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Applicability:** Use the Prototype pattern when a system should be independent of how its products are created, composed and represented; and
41
+
* when the classes to instantiate are specified at run-time, for example, by dynamic loading; or
42
+
* to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or
43
+
* when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state
44
+
38
45
##Singleton
39
46
**Intent:** Ensure a class only has one instance, and provide a global point of access to it.
0 commit comments