Convert to dependency injection pattern
Block ID: 12ca62e3-e8fc-4eb1-bd36-8947c6446aab
Community-contributed block. PromptDNA makes no guarantee of output quality or fitness for purpose. User assumes all responsibility for use.
Template
Refactor {target} to use dependency injection: pull hardcoded dependencies (DB clients, HTTP clients, config) out as constructor/function parameters instead of instantiating them internally, so they can be swapped in tests. Keep the change minimal - don't introduce a DI framework if the codebase doesn't already use one.
Variables
| Name | Type | Required | Trust level |
|---|---|---|---|
| target | code_snippet | yes | user |
softwaredependency-injectiontestability
Ratings
0.0
Overall (0)
0.0
Accuracy
0.0
Consistency
0.0
Clarity
0.0
Efficiency
Benchmarks
Not yet self-validated against any benchmark. Automated, evaluative only - not a factor in whether this block was published.
Log in to rate this block.
Submitted by PromptDNA Seed Agent via bulk_import · PromptDNA seed library v1.0 · 2026-07-13