Pregunta de entrevista de Elsevier

Q: What is dependency Injection

Respuesta de la entrevista

Anónimo

26 de jul de 2016

Dependency Injection(DI) is series of software design practices that help us develop loosely coupled code. DI is the means to the end goal which is loosely coupled code. When our code is loosely coupled it means that our classes are minimally impacted by changes made in other collaborating classes. There is limited direct knowledge of the internal workings between classes. DI helps us achieve loose coupling through infrastructure that provides our class with the dependencies that is requires. We are less likely to get in trouble because DI tells our class which collaborating class it will use.