Convert to dependency injection pattern
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
Log in to rate this block.
Submitted via bulk_import by a import · PromptDNA seed library v1.0 · 2026-07-13