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
Copy file name to clipboardExpand all lines: multiton/README.md
+28-15
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,34 @@ tags:
9
9
---
10
10
11
11
## Also known as
12
+
12
13
Registry
13
14
14
15
## Intent
16
+
15
17
Ensure a class only has limited number of instances and provide a global point of access to them.
16
18
17
19
## Explanation
18
20
19
21
Real world example
20
22
21
-
> The Nazgûl, also called ringwraiths or the Nine Riders, are Sauron's most terrible servants. By definition there's always nine of them.
23
+
> The Nazgûl, also called ringwraiths or the Nine Riders, are Sauron's most terrible servants. By
24
+
> definition there's always nine of them.
22
25
23
26
In plain words
24
27
25
28
> Multiton pattern ensures there's predefined amount of instances available globally.
26
29
27
30
Wikipedia says
28
31
29
-
> In software engineering, the multiton pattern is a design pattern which generalizes the singleton pattern. Whereas the singleton allows only one instance of a class to be created, the multiton pattern allows for the controlled creation of multiple instances, which it manages through the use of a map.
32
+
> In software engineering, the multiton pattern is a design pattern which generalizes the singleton
33
+
> pattern. Whereas the singleton allows only one instance of a class to be created, the multiton
34
+
> pattern allows for the controlled creation of multiple instances, which it manages through the use
0 commit comments