Problem
The codebase has inconsistent patterns for dependency management during initialization. Some components recreate objects from lower-level dependencies (like Clients) when higher-level objects (like Collections/wrappers) are already available or could be injected.
Pattern Observed
When using fx-based dependency injection, certain modules provide fully-configured objects. However, downstream initialization code sometimes ignores these and recreates equivalent objects from the underlying primitives with identical parameters.
This creates a pattern where:
- Module A provides Object X via dependency injection
- Component B receives the primitive that X wraps
- Component B recreates an equivalent X from the primitive
- Result: Two instances of X with identical configuration
Impact
- Consistency: Mixing dependency injection with manual object creation
- Maintainability: Duplicate initialization logic scattered across codebase
- Single source of truth: Multiple instances created from same configuration
- Code clarity: Unclear whether injected objects should be used or recreated
Suggestion
Review initialization paths to:
- Identify where fx-injected objects could be reused instead of recreated
- Thread injected dependencies through initialization chains consistently
- Document patterns for when to inject vs. recreate dependencies
- Ensure fx-based and non-fx paths have clear, consistent patterns
This is a code health and design consistency issue that affects maintainability.
Problem
The codebase has inconsistent patterns for dependency management during initialization. Some components recreate objects from lower-level dependencies (like Clients) when higher-level objects (like Collections/wrappers) are already available or could be injected.
Pattern Observed
When using fx-based dependency injection, certain modules provide fully-configured objects. However, downstream initialization code sometimes ignores these and recreates equivalent objects from the underlying primitives with identical parameters.
This creates a pattern where:
Impact
Suggestion
Review initialization paths to:
This is a code health and design consistency issue that affects maintainability.