I have been using the StartableFacility during the registration of my service.
My service is publicly registered as an interface, but the 'start' method belongs to the concrete type.
When I register like this:
container.Register(
Component.For<IQueryRemoteHandler>().ImplementedBy<ServerQueryRemotingHandler>()
.StartUsingMethod(server => (server as ServerQueryRemotingHandler).Start)
);
You see I have to cast my service before I can get to the 'start' method
This suggestion is really just about usability: Shouldn't the generic type argument for the 'StartUsingMethod' be the 'ImplementedBy' type, not the 'For' type?
The container knows the concrete type, so it should be able to pass that to the StartUsingMethod... not the interface
What do you think?
Adam Langley
Senior Developer
+64 9 486 9010
+64 21 884400
alan...@winscribe.com
www.winscribe.com
Please consider the environment before printing this email!
Always a trade off