What differs from MCSF and IoC?

Jun 9, 2010 at 5:14 PM

I'm just starting to look into the IoC fx and it seems that it's alot like MCSF. Same concepts, DI, WorkItem, SmartPart, Modules, etc. 

What improvements IoC brings?

Seems like IoC is a strip down version of MCSF, what MCSF has that IoC doesn't? 

Thanks!

Coordinator
Jun 9, 2010 at 5:24 PM

Yes, IoC is a lot like CAB/SCSF - in fact I used the desktop model for the general interface definition to make it easy for people familiar with SCSF/MCSF to understand and to port to.

However, IoC is nothing like MCSF under the hood.  MCSF is slow as molasses and I felt way, way too big. In fact I think the SCSF on the desktop is too big as well.  IoC has a subset of the SCSF.MCSF features that I felt were useful.  Everything else I jettisoned.  IoC was written from the ground up, specifically looking at what is important in a resource constrained, small CPU environment.  That menas that I scrutinized everything for performance (something the MCSF devs obviously didn't do).

So what does MCSF have that IoC doesn't?  IMO a lot of stuff that is useful only for edge-case scenarios plus very poor performance and memory utilization.

Jun 9, 2010 at 5:44 PM

What about performance of IoC, it does have quite a bit of reflection going on with DI, Event Aggragation. Doesn't reflection has a big impact on mobile device? 

Coordinator
Jun 9, 2010 at 8:35 PM

Sure, reflection is slower than running pre-compiled references, but there's no way around using reflection for doing what we're after.  To help mitigate the impact of reflection IoC caches type information so it only ever has to reflect on a given type once.  What that means is the first time you create an object with the ObjectFactory, you pay the perf penalty for reflection, but for every time after that you don't.  If you wish to avoid the reflection penalty for object creation you can manually create the objects and call Add instead of AddNew (though some reflection still has to occur for event aggregation).