Is Abstract Factory just a collection of Factory methods?

Is Abstract Factory just a collection of Factory methods? Or is there any other difference between these patterns?

+3
source share
3 answers

According to Design Patterns , page 95:

Abstract Factory classes are often implemented using factory methods, but they can also be implemented using Prototype.

+2
source

IMHO , factory abstract, , . factory , .

, factory. , , factory , mock factory .

factory factory , .

+1

Factory .

Factory .

The difference: Abstract Factory usually implemented as a Singleton, which would create a family of objects. It is usually installed while the application is loading and not changing after that.

On the other hand, it is Factory Methodusually not a thematic group or singleton. Instead, it is an implementation that allows you to flexibly create objects. Thus, it does not necessarily create a family of objects

Similarity . Both of them are similar to each other, since they both separate the creation of an object from its code.

Here is a good pdffile. Check this.

0
source

All Articles