Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7031

Allow injectable component configuration to be mapped via com.google.inject.Key instead of just Class

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.5.5
    • None
    • None
    • None

      The main advantage of Key vs Class when it comes to Guice configuration is that the former allows to add context information to the type with binding annotations (Key.get(class, annotation)).

      This is the crucial mechanism which enables the effort of UI IoC optimisation, where we allow to map types to different impls depending on the UI context.
      Unfortunately, our API which connects our module descriptors (XML) with the Guice binding DSLs (Java) only exposes the ability to map the types over Class literals.

      I suggest to change the underlying behaviour to rely on the Keys instead of Classes (this is 99% binary compatible since almost no public API is touched). Another proposal is to allow to configure the component annotations through our configuration classes.

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              apchelintcev Aleksandr Pchelintcev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD