Dependency Injection Using MEF
1. Introduction "Dependency Injection is a design pattern that takes away the responsibility of creating dependencies from a class thus resulting in a loosely coupled system." Or "Dependency Injection means that this is done without the object intervention, usually by a framework component that passes constructor parameters and set properties." In order to understand DI you need to understand below terms: Dependency: Dependency means a class depends on other class’s object for its working. Example: public class Employee { private dbHelper helper; Employee() { Helper = new dbHelper(); } } Here in this example working of class Employee is dependent on object of dbHelper. Dependency Inversion Principle (DIP): It states that “High-level modules should not depend on low-level modules. Both should depend on abstractions”. Inversion of Control (IOC): Inversion of…

