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
**Intent:** Enforces a behaviour like sharing the same state amongst all instances.
11
+
12
+

13
+
14
+
**Applicability:** Use the Monostate pattern when
15
+
16
+
* The same state must be shared across all instances of a class.
17
+
* Typically this pattern might be used everywhere a SingleTon might be used. Singleton usage however is not transparent, Monostate usage is.
18
+
* Monostate has one major advantage over singleton. The subclasses might decorate the shared state as they wish and hence can provide dynamically different behaviour than the base class.
0 commit comments