mardi 26 décembre 2017

Why are annotations used with java on Dependecy Injection

so I am reading about the Dependency Injection for the first time. I think I have figured it out and I have understood an example written for PHP. Though, I was reading this JAVA tutorial and it insists on adding annotations. If I am going to offer the the class its dependency externally using the constructor for example, then what why are the annotations required? Also, I am reading on the Spring framework, which also states you need annotations. How do the annotations fit in? Any information is appreciated.




Aucun commentaire:

Enregistrer un commentaire