IoC library compatible with MonoTouch?

2019-02-08 11:07发布

Still getting familiar with the limits of MonoTouch. Is there an IoC/DI library that can be used with MonoTouch. Something like Ninject ideally?

6条回答
beautiful°
2楼-- · 2019-02-08 11:33

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/

查看更多
你好瞎i
3楼-- · 2019-02-08 11:33

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.)

查看更多
5楼-- · 2019-02-08 11:48

take a look on TikoContainer. Pretty easy to use

查看更多
手持菜刀,她持情操
6楼-- · 2019-02-08 11:56

The OpenNETCF IoC container now supports MonoTouch as well.

查看更多
Fickle 薄情
7楼-- · 2019-02-08 11:58

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.

查看更多
登录 后发表回答