IoC 库与 MonoTouch 兼容吗?
仍在熟悉 MonoTouch 的局限性。是否有可与 MonoTouch 一起使用的 IoC/DI 库。理想情况下是像 Ninject 这样的东西吗?
Still getting familiar with the limits of MonoTouch. Is there an IoC/DI library that can be used with MonoTouch. Something like Ninject ideally?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试一下 TinyIoC -
干杯,
克里斯NTR
Give TinyIoC a try - http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/
Cheers,
ChrisNTR
我经历了这个评估过程,我发现 Funq 是一个很好、干净的实现,它给了我足够的能力来做我想做的事情,而不会过度复杂化事情(或者拖动是大量的依赖项)。
它漂亮、干净,并且支持通过 lambda 表达式进行惰性对象初始化。
我评估了 5 或 6 个专门用于 MonoTouch 的不同容器。
http://funq.codeplex.com/
I went through this evaluation process, and I found that Funq was a nice clean implementation that gave me enough power to do what I wanted without over complicating things (or dragging is massive dependencies).
It's nice and clean, and supports lazy object initialization through lambda expressions.
I evaluated 5 or 6 different containers specifically for use with MonoTouch.
http://funq.codeplex.com/
看看 TikoContainer。非常容易使用
take a look on TikoContainer. Pretty easy to use
OpenNETCF IoC 容器 现在也支持 MonoTouch。
The OpenNETCF IoC container now supports MonoTouch as well.
我想提一下 Spring.Net,我们在所有应用程序中广泛使用原始的 [Java] 版本。
Spring [至少在 Java 上] 有很多。许多[可选]模块。我自己还没有尝试过 .Net 版本,但我有兴趣了解它的比较情况。
干杯
丰富
P.S. Spring.Net 是 Apache 许可的,因此它可用于闭源、商业项目(例如 iOS/iPhone 等)
Thought I'd mention Spring.Net, we use the original [Java] version extensively in all our applications.
Spring [on Java, at least] has many. many [optional] modules. I haven't tried the .Net version myself, but I'm interested to find out how it compares.
Cheers
Rich
P.S. Spring.Net is Apache licensed, so its usable in closed source, commercial projects (think iOS/iPhone etc.)
我发布了 Stiletto,这是一个适用于所有 .NET 平台(包括 Xamarin 和 MonoTouch)的 IoC。它允许您主要使用属性来指定依赖项,并通过在编译时执行操作来绕过运行时反射和通用实例化的限制。
编辑
我必须更新文档,但预编译工具不能与Xamarin Studio中的当前构建工具一起使用。 Stiletto 预编译需要 xbuild,Xamarin.Android 支持 xbuild,但 Xamarin.iOS 不支持!不幸的是,这意味着我的答案大部分是不正确的 - 也就是说,除非你想在 Visual Studio 中编写 iOS 应用程序,而这正是我一直在做的!抱歉。过几天就会删除这个答案。
I've released Stiletto, an IoC that works on all .NET platforms, including Xamarin and MonoTouch. It lets you specify your dependencies mainly using attributes, and gets around limitations on runtime reflection and generic instantiations by doing its thing at compile-time.
EDIT
I'll have to update the docs, but the pre-compile tool does not work with the current build tools in Xamarin Studio. Stiletto pre-compilation requires xbuild, which is supported for Xamarin.Android but not for Xamarin.iOS! Unfortunately, this means that my answer is mostly incorrect - that is, unless you want to write iOS apps in Visual Studio, which is what I'd been doing! Apologies. Will delete this answer in a few days.