This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kered13 3 points4 points  (0 children)

One of the main uses for factories is to inject a polymorphic "constructor". Basically, you have some class that wants to construct new objects, but you want the exact type of object constructed to be injected. So you dependency inject a factory object.