WP7 上的 Spring IoC?
WP7上可以使用Spring.net吗?您会推荐其他适用于 WP7 的 DI/IoC 容器吗?为什么?
Is it possible to use Spring.net on WP7? Would you recommend others DI/IoC-Containers for WP7 and why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
据我所知,Spring 的 IoC 无法在 WP7 上运行,因为 WP7 的运行时库有限。 Spring 依赖于 WP7 世界中不存在的东西。
我使用并推荐的一种是 MicroIoC。它体积小、集成简单、重量轻,并且在 WP7 上运行良好。
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.
WP7 的替代 IoC 容器实现包括:
Alternative IoC container implementations for WP7 include:
我在 TinyIoC https://github.com/grumpydev/TinyIoC 方面取得了很好的成功
,非常简单,只是在您的解决方案中包含一个 C# 文件,就可以开始了!它还具有自动注册功能,可以自动将接口映射到其实现(假设您只有一个实现)和类。
还使用 TinyMessenger 在表示层和业务逻辑之间松散耦合消息(假设您使用 MVVM 或其他表示模式)。
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).
我听说过很多关于 WP7 上的 Ninject (https://github.com/ninject/ninject) 的好消息 - 但我自己没有使用过
I've heard lots of good things about Ninject (https://github.com/ninject/ninject) on WP7 - but not used it myself