Unity - viable option for Windows Mobile development?

Sep 15, 2008 at 10:47 PM
So I'm faced with a project where the target deployment platform might very well be Windows Mobile 6.0 - which from what I gather rules out quite a few building blocks that we otherwise use at our organization. Enterprise Library being one of them.

What I'm wondering is how can I achieve an IoC container-like degree of loose coupling on Windows Mobile. Can Unity be used? What about his competitors like Windows or Spring.NET or StructureMap... I'd prefer to align this effort with the P&P deliverables but also need to ensure my design can be realized on the target platform.

At this point I'm steering our UML modeling efforts to utilize classes with discrete interfaces so that a "Controller" implementing "IController" can be used by registering "IController" with some form of container. The question becomes whether I can use an existing solution such as Unity or whether I have to come up with some "poort mans" container on Mobile and forego dependency injection and simply use the "container" as a "locator" providing mapping of interfaces to implementations.

The simple mapping of interface to implementation will help with loosely coupling the modules in the system (preventing circular references / dependency chains) and some versatility in swapping out implementations (i.e. a NullLogger class for ILogger) but won't provide any further benefit for IoC/DI...

What are my options here? If Unity is NOT an option on Mobile, what is the future plans - if any - for an IoC/DI container for Windows Mobile?  From what I'm seeing, the world of Mobile development is a far cry from the current Web/WinForm worlds...
Sep 16, 2008 at 8:49 PM
Mobile is explicitly not a supported platform for Unity - it's just too different from the regular desktop CLR for a straight port to make sense. One thing that has hindered DI container development on Mobile is that reflection is very, very, VERY slow on Mobile. p&p tried to build something around ObjectBuilder in the Mobile Client Software Factory project. The reflection costs were so high they ended up writing a preprocessor to calculate the injection stuff at compile time. You might want to check that project out.

I don't know about any other groups, but the Entlib/Unity team doesn't have any plans for the Mobile platform at the moment.

Sep 24, 2008 at 12:35 AM
Edited Sep 24, 2008 at 12:36 AM
That was the answer I dreaded. It really seems like the state of affairs for Mobile development is a joke. MS can't really expect Mobile development to be embraced when there is such as disparity between the 2 platforms (Mobile versus XP/Vista/Server)... So much for build once and re-use on the CLR which happens to run on a mobile device.

And as far as Mobile Client Software Factory.... it looks like AbandonWare to me... So we've all but ruled it out lately - perhaps trying to salvage some blocks it provided but hell - the MSI installer won't even install the source without a dependency that is no longer available for download from MS (GAX/GAT related). I did see a group here on CodePlex with something called "Mobile Blocks' that looks like a crew trying to carry MCSF forward for VS2008 but without the backing of P&P it's hard to endorse for my client's solution. I was hoping teh Smart Client Software Factory was just going to end up being a 'universal' kit that handled online/offline non-web app regardless of XP/Vista versus Windows Mobile... should (in theory) be the same code base... the CLR....

At least the client is looking at a "mobile" device that runs XP/Vista and is just small form factor. I'm thinking we need to steer the ship in that direction - Mobile development is just not mature enough and presents too much of a disparity when trying to re-use components from a component based system on a "mobile" platform.

Sigh. At least I know from a co-worker that the state of affairs for Java ME is just as deplorable...