Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IoC library compatible with MonoTouch?

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

like image 587
Ross Hambrick Avatar asked Apr 12 '10 02:04

Ross Hambrick


People also ask

What is IoC container in xamarin forms?

Using the IoC principle, we use an abstraction for the functionality in our shared code and pass an implementation of the abstraction into our shared code. Our IoC containers handle the instantiation of an object's dependency tree. We can register objects to their inherited interfaces and allow containers to pass ...

How many dependencies should a class have?

The fact your class has so many dependencies indicates there are more than one responsibilities within the class. Often there is an implicit domain concept waiting to be made explicit by identifying it and making it into its own service. Generally speaking, most classes should never need more than 4-5 dependencies.

What is dependency injection framework?

Dependency injection in . NET is a built-in part of the framework, along with configuration, logging, and the options pattern. A dependency is an object that another object depends on. Examine the following MessageWriter class with a Write method that other classes depend on: C# Copy.


2 Answers

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

like image 120
chrisntr Avatar answered Oct 21 '22 13:10

chrisntr


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/

like image 31
Adam Avatar answered Oct 21 '22 14:10

Adam