View RSS Feed

Patterns

  1. The Multiton pattern

    by , 08-12-2011 at 04:39 AM
    The Multiton pattern is a pattern missing from ”the pattern bible”. It is extensive to dual layer (and beyond), but that is left for you to use intuitively when needed, it is not too difficult to do so.

    The Multiton pattern is an extension of Singleton pattern.
    Multiton lets you create and get any number of instances, they are distinguished by keys,
    so if you want instance "a" it creates it for you the first time, and returned the created instance the next ...

    Updated 08-12-2011 at 06:16 PM by Hibernate

    Categories
    Patterns
  2. The Singleton pattern

    by , 08-12-2011 at 04:29 AM
    In mathematics a singleton (not to be confused with a simpleton) is a set with exactly one element.
    In computer science Singleton is a pattern which enforces the existence of only up to one instance of a class.

    Singleton is sometimes considered an anti-pattern, and it's famous for being considered unnecessary in the world of Python (where you duck type).
    Singleton is however useful, it is a nice and clean why to restrict the number of instances, to only one.
    In ...

    Updated 08-12-2011 at 06:13 PM by Hibernate (typo)

    Categories
    Patterns