dickwall/subcut — Issue #11: Just-in-time bindings via default, no-arg constructor
Author: jhalterman
Created: 2012-01-21 07:29:59+00:00
State: open

For injection requests where there is no corresponding binding, if the requested type is concrete and instantiable, it would be great if subcut would create a "just in time" binding for the requested type. This would essentially bind the type to itself inside the module from which injection was requested.

The benefit is this saves users from having to create self bindings just to make a module aware of a type:

bind[A].toClass[A]

The idea is borrowed from Guice, which implements basically the same thing.