...
| Spring | PicoContainer | Guice |
---|---|---|---|
Supports start/stop lifecycle hooks for components | Yes (interface or xml-configured) | Yes (interface or annotation) | |
Supports autowiring | Yes | Yes | Yes |
Supports in-code wiring and configuration | Yes (JavaConfig) | Yes | Yes |
Supports external wiring (outside of code) | Yes (xml) | No | Not directly (but it's possible) |
Supports external config (outside of code) | Yes (xml and/or properties) | No | Yes (Names.bindProperties) |
OSGi-Friendly | Yes (Spring-DM) | Unknown | Yes (Guice-Peaberry) |
JSR-330 Support | |||
Jar Footprint (non-OSGi) | 750kb | 300kb | 650kb |
Implementation Strategy/Principles
- Prefer constructor injection to setter injection
- Minimize coupling of code with DI framework
...
- Minimize changes to existing runtime functionality
Implementation Plan
Phase I - Preparation
- List all dependents of existing module interfaces.
- Identify and remove unused modules.
- Identify and address circular module dependencies. Refactor if possible; otherwise prepare to use setter injection in these cases.
Phase II
- Profit
Implementation Steps
...
Current Inter-Module Dependencies
...