Difference between Factory and Abstract Factory Pattern?

 Posted by Rajnilari2015 on 12/19/2015 | Category: Design Pattern & Practices Interview questions | Views: 2799 | Points: 40
Answer:

a) Abstract Factory can be use while we need to produce multiple factories (for producing multiple items) which it does through multiple factory methods via composition whereas in case of factory pattern, the object creation happens through a single factory method for only one single item.

b) Another difference that we can say is that, in the case of Factory the object creation happens directly through the class instance of the factory (we can use DP but again underlying the same stuff) as opposed to the Abstract Factory where it happens through interface


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response