-
Couldn't load subscription status.
- Fork 36
Open
Description
With current design an end user must bind both a factory interface to a factory and the result interface to a concrete type:
kernel.Bind<IFooFactory>().ToFactory();
kernel.Bind<IFoo>().To<Foo>();
This creates a danger (actually have happened) of ability to inject IFoo directly bypassing the factory just because its interface binding is required for the factory to work.
Ideally, in such cases the extension method should be ToFactoryOf<Foo>() or ToFactory().Of<Foo>() which allows explicitly specify the implementation type without a necessity to bind it.
bdphil86
Metadata
Metadata
Assignees
Labels
No labels