In software engineering, the multiton pattern is a design pattern similar to the singleton, which allows only one instance of a class to be created. The multiton pattern expands on the singleton concept to manage a map of named instances as key-value pairs.
Rather than have a single instance per application (e.g. the java.lang.Runtime
object in the Java programming language) the multiton pattern instead ensures a single instance per key.
Most people and textbooks consider this a singleton pattern. For example, multiton does not explicitly appear in the highly regarded object-oriented programming text book Design Patterns (it appears as a more flexible approach named registry of singletons).
Read more about Multiton Pattern: Clarification of Example Code, Drawbacks
Famous quotes containing the word pattern:
“Our national experience in Americanizing millions of Europeans whose chief wish was to become Americans has been a heady wine which has made us believe, as perhaps no nation before us has ever believed, that, given the slimmest chance, all peoples will pattern themselves upon our model.”
—Ruth Benedict (18871948)