Is there any IoC container out there which supports (or can be made to) the Portable Class Libraries yet?
I fiddled around with some (SimpleInjector, AutoFac) but they always had one dependency or another which prevented me from using them as a portable class library.
I'm fairly new to the topic so I maybe totally on the wrong track here.
In more detail:
I want to create a library containing my models (and later viewmodels) for a MMVM app which should run on .Net 4.5, WP7 and WinRT. This models should be saveable as files. Since the implementation of the particular save algorithms (desktop filesystem, isolated storage) is specific to every platform I hoped to utilize an IoC container to decouple it from the models themselves.
No, it is otherwise. IoC is a broad concept and DI is the design pattern to implement the core of IoC. MEF is some form of DI, but it has not all fundamental features of IoC. MEF uses composition to find out the dependencies it needs to resolve.
The IoC container that is also known as a DI Container is a framework for implementing automatic dependency injection very effectively. It manages the complete object creation and its lifetime, as well as it also injects the dependencies into the classes.
Dependency Injection is the method of providing the dependencies and Inversion of Control is the end result of Dependency Injection. IoC is a design principle where the control flow of the program is inverted. Dependency Injection is one of the subtypes of the IOC principle.
I believe there is a beta of autofac for portable libraries: http://code.google.com/p/autofac/downloads/detail?name=Autofac-2.6.1.841-Portable.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With