Skip to content
DevDisciplineNIGHT CITY NEVER SLEEPS
Blog+About
Loading
DevDiscipline
instagramlinkedin

© 2026 ALPARSLAN SELÇUK DEVELİOĞLU

Privacy Policy·Terms of Service

Leave your email. I will send new posts.

Blog+

Built for my own writing practice. Editor, SEO, multilingual — all in one.

See Details
Archive
SearchBlog+About
The Moment My Ex-Manager Was Rightfully Angry at Me : Dagger Hilt and the DI Lesson | DevDiscipline
Software7 min1 views

The Moment My Ex-Manager Was Rightfully Angry at Me : Dagger Hilt and the DI Lesson

Logged: June 3, 2026

TL;DR

A developer skipped adding Dagger to a small Android tablet app, thinking it wasn't needed. As the project grew to integrate multiple third-party services with different endpoints, the codebase became messy. Dagger Hilt's @Qualifier annotations would have made managing multiple clients and base URLs much cleaner from the start.

  • Small practical notes
  • Dependency Injection (DI) Isn’t Just That
  • The Heart of DI: “Inversion of Control” and Composition Root
  • Anti-Pattern: Service Locator vs. Pure DI
  • Conclusion

Contents

  • Small practical notes
  • Dependency Injection (DI) Isn’t Just That
  • The Heart of DI: “Inversion of Control” and Composition Root
  • Anti-Pattern: Service Locator vs. Pure DI
  • Conclusion

Do not miss new posts

I can send notes like this by email. No noise, just new posts.

Frequently Asked Questions

▸Why should you add dependency injection to a small Android project early on?

Small projects can grow unexpectedly. In this case, a simple tablet app eventually needed to connect to a valet QR system, an Oracle hotel database, and multiple other services. Adding DI early would have made scaling those connections far less painful.

▸How do you handle multiple base URLs in Android with Dagger Hilt?

You use @Qualifier annotations to distinguish between different OkHttpClient, Retrofit, and API service instances. Each service gets its own qualifier (e.g., @BaseClient, @ValeClient, @HotelClient), so Hilt knows exactly which dependency to inject where.

▸What is the difference between Dagger and Dagger Hilt for Android?

Dagger is the original dependency injection framework, but setting it up in Android projects was complex and error-prone. Hilt is built on top of Dagger and simplifies the setup with Android-specific components like SingletonComponent, making DI much easier to add and maintain.

Software Engineering Series

#1A Document-Based Legal AI That Can Say "I Don't Know"#1Opening 11 Million Character HTML in a Mobile WebView: Virtual Chunking#1Vibe Coding for 10 Years Experienced Software Developer#1The Moment My Ex-Manager Was Rightfully Angry at Me : Dagger Hilt and the DI Lesson// reading
Series Index: 4 entries recordeddev_discipline://series_meta
#technical debt#software architecture#dependency injection#android development#dagger hilt

You May Also Like

A Document-Based Legal AI That Can Say "I Don't Know"
Software

A Document-Based Legal AI That Can Say "I Don't Know"

12 minMay 28, 2026
Opening 11 Million Character HTML in a Mobile WebView: Virtual Chunking
Software

Opening 11 Million Character HTML in a Mobile WebView: Virtual Chunking

9 minApril 18, 2026
Vibe Coding for 10 Years Experienced Software Developer
Software

Vibe Coding for 10 Years Experienced Software Developer

11 minMay 24, 2026