[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: |
|
||||||||||||
| 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. 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. |