[MAGNOLIA-7031] Allow injectable component configuration to be mapped via com.google.inject.Key instead of just Class Created: 17/May/17  Updated: 29/Sep/17  Resolved: 01/Jun/17

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5.5

Type: Improvement Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
dependency
is depended upon by MGNLUI-4180 Conduct UI-related IoC binding withou... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

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.


Generated at Mon Feb 12 04:20:05 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.