Factory Method Pattern - Other Benefits and Variants

Other Benefits and Variants

Although the motivation behind the factory method pattern is to allow subclasses to choose which type of object to create, there are other benefits to using factory methods, many of which do not depend on subclassing. Therefore, it is common to define "factory methods" that are not polymorphic to create objects in order to gain these other benefits. Such methods are often static.

Read more about this topic:  Factory Method Pattern

Famous quotes containing the words benefits and/or variants:

    When your parents are in political life, you aren’t normal. Everybody talks about the benefits, but I don’t know what the benefits are.... But I’d rather have that kind of mother than an overweight housewife.
    Katherine Berman Mariano (b. 1957)

    Nationalist pride, like other variants of pride, can be a substitute for self-respect.
    Eric Hoffer (1902–1983)