Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Builder Vs Factory

 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How builder pattern is different from Factory pattern?
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:How builder pattern is different from Factory pattern?


Surely you've looked this up on Wikipedia or Googled it, correct? So rather than ask such a general question, wouldn't it be better for you to post what specifically about the two patterns confuse you?
 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this answer from one of the javaranch post.

Abstract Factory: Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Builder: Separate the construction of a complex object from its representation so that the same construction process can create different representations.
Factory Method: Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic