2

Is it possible to use Spring.net on WP7? Would you recommend others DI/IoC-Containers for WP7 and why?

Beachwalker
  • 7,685
  • 6
  • 52
  • 94

4 Answers4

6

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.

vcsjones
  • 138,677
  • 31
  • 291
  • 286
  • 1
    It would be funny if half of the battery was consumed by spring resolving references. – TrustyCoder Mar 23 '11 at 18:19
  • I am just interested whether it is possible to reuse (parts of) the config. – Beachwalker Mar 23 '11 at 18:31
  • Another vote for MicroIoC. It's teeny, fluent, and integrates nicely with Caliburn Micro. – Ben Gracewood Mar 25 '11 at 10:03
  • But MicroIoC doesn't seem to be stable. I can't see any releases!? Used in production environments? – Beachwalker Mar 28 '11 at 07:28
  • @Stegi - It doesn't have any offical releases, but it works well. Just hit the "Source Code" tab and "Download" for the latest source, and compile it yourself. – vcsjones Mar 28 '11 at 13:50
  • @vcsjones - thanks for the plug - glad you're enjoying it :) @stegi - I think the code is stable. Ping me on codeplex if you find any issues :) – kiwipom Mar 28 '11 at 20:25
6

Alternative IoC container implementations for WP7 include:

Derek Lakin
  • 16,179
  • 36
  • 51
1

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

ogborstad
  • 2,309
  • 2
  • 19
  • 22
0

I've heard lots of good things about Ninject (https://github.com/ninject/ninject) on WP7 - but not used it myself

Stuart
  • 66,722
  • 7
  • 114
  • 165