Guice: Why lightweight dependency injection frameworks are not enough
summary
Attempting Guice for a simple web app produces concrete tradeoffs: you end up writing 50 lines of Tomcat config because there are no useful defaults, GitHub docs are stale, and dependency annotations collide — Jakarta vs Guice @Inject mismatch breaks component scanning. Connecting HTTP needs Jersey plus an HK2 adapter between Guice and Jersey that is undocumented, OpenAPI must be generated and scrubbed programmatically, logging frameworks often fail and JUnit needs custom extensions to run integration tests. The framework works only after stitching many hacks.
AI-written summary · about
chapters (11)
- 0:00Guice introduction
- 1:30Spring vs Guice
- 2:59Guice setup challenges
- 4:05Tomcat with Guice
- 5:09Lack of documentation and broken examples
- 6:09Jakarta vs Guice
- 7:12Guice with Jersey
- 8:37Swagger in Guice
- 10:02Guice logging
- 11:11Testing Guice
- 13:24Lessons learned and project abandonment
related talks
34mJava Modules meet Dependency Injection
49mSpring, Jakarta EE, CDI and Other Pathologies
56mDI Frameworks – some hidden pearls
41mJava Beyond Frameworks: Avoiding Lock-In with Agnostic Design
18mwith Inversion Control
56mJava libraries you can't afford to miss (Student Day)
49mOn @annotations - liberate yourselves from demons
53mModern Java Component Design with Spring 4.3
