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 with benefits as with injuries in this respect, that we do not so much weigh the accidental good or evil they do us, as that which they were designed to do us.That is, we consider no part of them so much as their intention.”
—Laurence Sterne (17131768)
“Nationalist pride, like other variants of pride, can be a substitute for self-respect.”
—Eric Hoffer (19021983)