vendredi 22 janvier 2016

Dependency injection in java spring mvc

I have gone through many of the stackoverflow answers for the same but I think I am still not clear. What I understood is:
1)If we create direct objects like A a=new A(); it would be difficult to change/handle information everytime.
2) Dependency injection provides us what we want at runtime instead of compile time.
3)In spring to achieve to dependency injection we must use parameterized constructors and setter methods (mandatory).
4)Dependency injection is used to keep your code CLEAN and STABLE. What do you mean by clean and stable ?? (Please elaborate if you know in SIMPLE words)
This is what I understood so far .Please correct me wherever I am wrong and please add some points( if any ) in very SIMPLE words so that I can understand easily .
Thanks in advance :)

Aucun commentaire:

Enregistrer un commentaire