Levi Mendes
Levi Mendes

Reputation: 123

What is the advantage of using a framework/library to make Dependency Injection?

I am studying about Dependency Injection, I realize that exists frameworks (dagger 2, spring, etc...) to make the Injection of objects, since I can achieve it by constructors, get/set, e.g. What is the advantage of using a framework/library to do it?

Upvotes: 1

Views: 46

Answers (1)

jbarat
jbarat

Reputation: 2460

You can archive dependency injection without any framework.

The points of the frameworks are to keep your code simple(r) to read and to speed up development. It is easier to just add @Inject on a field and add @Provide on a method then write it all yourself.

Upvotes: 1

Related Questions