Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is the difference between factory and abstract factory pattern?

user-image
Question ajoutée par Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
Date de publication: 2013/10/25
Daanish Rumani
par Daanish Rumani , Product Manager , Publicis Sapient

The Factory pattern is applicable for a single class whereas AbstractFactory is for a set of classes. AbstractFactory uses the Factory pattern for each class in addition to defining a few other things.

ahmad mohammed
par ahmad mohammed , JAVA team lead , edu-tek

With the Factory pattern, you produce implementations (Apple, Banana, Cherry, etc.) of a particular interface -- say, IFruit.

With the Abstract Factory pattern, you produce implementations of a particular Factory interface -- e.g.,IFruitFactory. Each of those knows how to create different kinds of fruit.

More Questions Like This