Status
Current state: Under Discussion
Discussion thread:
JIRA:
Released: -
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast). Confluence supports inline comments that can also be used.
Motivation
Use a standardized dependency injection in Solr instead of our home grown @SolrCoreAware, @ResourceLoaderAware, @SchemaAware etc.
Proposal is to do a trial with Dagger2 (https://github.com/google/dagger) which is a compile-time depenency injection framework.
Public Interfaces
Many plugins will change API which will affect back-compat.
Proposed Changes
Introduce a well supported IOC/DI framework to gradually replace the home-grown interfaces which are brittle (see https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java#L815-L816)
,This will be a large change across the entire code base. Dagger will scan the codebase for annotations and generate new Java code that will be used run-time.
The exact scope is still unclear, but we recommend starting with a small module or one interface.
Compatibility, Deprecation, and Migration Plan
- Users will not notice anything
- Developers and 3rd party plugin providers may need to re-write their plugins
- The change is breaking and should be introduced in a major version
Security considerations
None
Test Plan
Will be tested implicitly by the test suite.
Rejected Alternatives
- Spring Framework - too intrusive
- Guice - injection happens during runtime
- Improve our own annotations