Zero friction IoC: Auto registration is mandatory
This is the entire Binsor config file for a real application:
import Castle.MonoRail.Framework import Castle.MonoRail.WindsorExtension import Rhino.Commons.Facilities from Rhino.Commons.ActiveRecord facility MonoRailFacility facility RhinoTransactionFacility facility ActiveRecordUnitOfWorkFacility: assembly = "HibernatingRhinos" for type in AllTypesBased of IController("HibernatingRhinos"): component type.Name, type for type in AllTypes("HibernatingRhinos").WhereNamespaceEq("HibernatingRhinos.Services"): component type.GetServiceInterface(), type
And I am pretty confident that I am not going to have to do much in the future with those.
And yes, you can do it with the fluent registration API as well.
Comments
When I last checked fluent registration API didn't have WhereNamespaceEq & GetServiceInterface. Those are your extension methods?
You can add a filter for that, it may be not as nice, but easily done.
Wow. Love it.
When I last checked binsor didn't support IRegistration! When was this feature added? My windsor.boo files are starting to get ugly. I can't wait to take this for a spin.
I see its worth, but I have many services/components that require configuration. Can I register a component twice, for example
for type in AllTypes("HibernatingRhinos").WhereNamespaceEq("HibernatingRhinos.Services"):
component HibernatingRhinos.Services.IFoo, Foo:
Or do I have to exclude Foo from the auto-registration?
Markus,
For that, you have the extend support, which allows you to do that.
Comment preview