Stefan,
It appears to me that most users of Prism will stick to the Unity container which ships with the Prism build. The reason for that is because they look at the Bootstrap class and are afraid to make the jump to Spring. I'd spent about 2 days and have a fully functional WPF 4 with Prism and CommonServiceLocator.SpringAdapter as the bridge between the container agnostic Prism code and the Spring Container. The pieces are there for you and your team to accomplish anything you need to. All you need is a bit of courage, a good cup of coffee, a bit of patience and a few Ben Harper albums.
I found the biggest challenge with inserting instances into the container and will offer you the code to do so:
Code:
protected void RegisterTypeIfMissing(object target, string name, bool registerAsSingleton)
{
_logger.LogTrace(string.Format("Registering object named: <{0}> as singleton: <{1}>", name, registerAsSingleton));
if (Container.ContainsObject(name))
{
_logger.LogInfo(String.Format("Type <{0}> is already registred ", target.GetType()));
}
else
{
if (registerAsSingleton)
{
Container.RegisterSingleton(name, target);
}
else
{
var objectDefinitionFactory = new DefaultObjectDefinitionFactory();
var builder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, target.GetType());
builder.SetSingleton(false).SetAutowireMode(AutoWiringMode.Constructor);
Container.RegisterObjectDefinition(name, builder.ObjectDefinition);
}
}
}
WPF is an amazing desktop development platform and spring's .net implementation provides all the necessary tools to take the headaches out of creating and wiring up objects, as well as many other functionality offered by the framework.