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:
“While greedy good-doers, beneficent beasts of prey,
Swarm over their lives enforcing benefits ...”
—Robert Frost (18741963)
“Nationalist pride, like other variants of pride, can be a substitute for self-respect.”
—Eric Hoffer (19021983)