Uber May 15, 2022

Managing Deep Scope Hierarchies in Large Codebases

Article Summary

Uber rewrote their Android rider app in 2016 and made an architectural choice that most Android teams avoid: deeply nested dependency injection scopes.

This article from Uber Engineering explains why their old two-layer scope architecture couldn't scale and how they built a deep scope hierarchy to support hundreds of cities with varying features. They ultimately created RIBs, their own architectural framework, when existing options fell short.

Key Takeaways

Critical Insight

Deep scope hierarchies solved Uber's scaling problems by eliminating coupling between features and removing stale state through short-lived, well-encapsulated scopes.

The article reveals why three-layer scope hierarchies still fail and includes specific code examples of their Dagger implementation.

Recent from Uber

Related Articles