Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    What you are calling the "Factory Method design pattern" sounds more like an Abstract Factory pattern to me. What you're calling the Factory Method IS the design pattern. See programmers.stackexchange.com/questions/81838/… Commented Mar 21, 2014 at 11:30
  • @pdr What I called a Factory Method is a method. How can one method be a pattern? Commented Mar 21, 2014 at 11:33
  • 1
    Check the link in @pdr's comment, it explains the Factory Method and Abstract Factory patterns beautifully. Commented Mar 21, 2014 at 11:44
  • @Prog - where does it say that a pattern should be anything more than a method? You could also look at this SO question for a very elaborate answer on the subject: stackoverflow.com/questions/4209791/… Commented Mar 21, 2014 at 11:45
  • 1
    @Prog: Yes. I would add that the Factory Method pattern is very specifically a method that selects which concrete implementation of a common supertype to return based on whatever information you give it. That's an important distinction from simply "a method that creates an object and returns it", which could easily include a constructor or the build part of the Builder pattern, neither of which are a Factory Method. Commented Mar 21, 2014 at 12:48