Refactor AppContext into scoped dependency structs per module #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
AppContextis a god object — every use case receives 20+ repositories and 8+ services even if it only needs 2.This means:
Proposed solution
Replace
AppContextwith scoped dependency structs per module. Each use case module declares a slim struct with only its dependencies:Composition roots (worker/presentation main.rs) build these from the master set of Arcs.
Notes
enrich_movieandrequest_enrichmentalready use individual Arc params (intentionally — called from adapters, not handlers). The scoped-struct approach is the middle ground.ReviewLoggertrait extraction (done) was a step in this direction.