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:
“Through all opposition the personal benefits of the reform [dress] [bracketed word in original] have compensated; but had it been mainly sacrifice, the thought of working for the amelioration of women and the elevation of humanity would still have been the beacon-star guiding me on amid all discouragements.”
—Susan Pecker Fowler (18231911)
“Nationalist pride, like other variants of pride, can be a substitute for self-respect.”
—Eric Hoffer (19021983)