Content deleted Content added
Narky Blert (talk | contribs) dab-needed tag |
|||
Line 7:
==Description==
While it may appear that the multiton is a [[hash table]] with synchronized access there are two important distinctions. First, the multiton does not allow clients to add mappings. Secondly, the multiton never returns a [[Null (computer programming)|null]]{{dn|date=January 2021}} or empty reference; instead, it creates and stores a multiton instance on the first request with the associated key. Subsequent requests with the same key return the original instance. A hash table is merely an implementation detail and not the only possible approach. The pattern simplifies retrieval of shared objects in an application.
Since the object pool is created only once, being a member associated with the class (instead of the instance), the multiton retains its flat behavior rather than evolving into a [[Tree (data structure)|tree structure]].
|