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:

    It is too late in the century for women who have received the benefits of co-education in schools and colleges, and who bear their full share in the world’s work, not to care who make the laws, who expound and who administer them.
    J. Ellen Foster (1840–1910)

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