You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (JIRA)" <ji...@apache.org> on 2017/03/07 11:48:37 UTC

[jira] [Created] (CAY-2258) DI: typesafe binding of List and Map

Nikita Timofeev created CAY-2258:
------------------------------------

             Summary: DI: typesafe binding of List and Map 
                 Key: CAY-2258
                 URL: https://issues.apache.org/jira/browse/CAY-2258
             Project: Cayenne
          Issue Type: Improvement
          Components: Core Library
            Reporter: Nikita Timofeev
            Assignee: Nikita Timofeev


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
{code}
    <T> MapBuilder<T> bindMap(Class<T> valueType);
    <T> MapBuilder<T> bindMap(Class<T> valueType, String bindingName);
    <T> ListBuilder<T> bindList(Class<T> type, String bindingName);
    <T> ListBuilder<T> bindList(Class<T> type);
{code}
And deprecate non type-safe methods:
{code}
    <T> MapBuilder<T> bindMap(String bindingName);
    <T> ListBuilder<T> bindList(String bindingName);
{code}

*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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)