Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The goal of this improvement is to add compile time type-safety to dependency injection of Lists and Maps.
Proposed changes in DI API:
Add following methods in Binder interface
<T> MapBuilder<T> bindMap(Class<T> valueType); <T> MapBuilder<T> bindMap(Class<T> valueType, String bindingName); <T> ListBuilder<T> bindList(Class<T> valueType, String bindingName); <T> ListBuilder<T> bindList(Class<T> valueType);
And deprecate non type-safe methods:
<T> MapBuilder<T> bindMap(String bindingName); <T> ListBuilder<T> bindList(String bindingName);
Incompatibility
If Cayenne DI is used in third-party code (custom modules or Cayenne modifications) the code should be updated if bindings other than List<Object> and Map<String, Object> were used, as this code will be broken.