Spring IoC on WP7?
Is it possible to use Spring.net on WP7? Would you recommend others DI/开发者_开发百科IoC-Containers for WP7 and why?
As far as I know, Spring's IoC won't run on WP7 since WP7 has limited runtime libraries. Spring depends on things that just don't exist in the WP7 world.
One that I use, and can recommend is MicroIoC. It's small, simple to integrate, lightweight, and works great on WP7.
Alternative IoC container implementations for WP7 include:
- Ninject
- SimpleContainer from Caliburn.Micro.
- MicroIoC
- Funq by Clarius Consulting
- OpenNetCF.IoC
I have had good success with TinyIoC https://github.com/grumpydev/TinyIoC
Is really simple, just include a single C# file in your solution and you're good to go! It also features an Autoregister function which maps interfaces to their implementation (given you have only one implementation) and classes automatically.
Also using TinyMessenger for loosely coupled messages between your presentation layer and business logics (say if you're using MVVM or some other presentation pattern).
I've heard lots of good things about Ninject (https://github.com/ninject/ninject) on WP7 - but not used it myself
精彩评论