Dependency Injection (IoC)
✔️ Objects can be added and tested independently of other objects.
✔️ Because they don’t depend on anything other than what you pass them.
✔️ To test an object you have to create an environment where all of its dependencies exist and are reachable before you can test it.
✔️ With DI, it’s possible to test the object in isolation passing it mock objects for the ones you don’t want or need to create.
✔️ Likewise, adding a class to a project is facilitated because the class is self-contained.
✔️ DI frameworks are often driven by XML files that help specify what to pass to whom and when.
✔️ IoC describes that a dependency injection needs to be done by an external entity instead of creating the dependencies by component itself.
✔️ Dependency injection is a process of injecting (pushing) the dependencies into an object
Follow me @
✍️ https://raviroza.blogspot.com/
✍️ https://www.facebook.com/ravi.oza.it
✍️ https://twitter.com/raviozaIT
📹 https://www.youtube.com/user/ravioza101