Why this matters
Improves testability, configuration, and lifecycle management.
Obtain collaborators via constructor injection (or a DI container) instead of new/service locators in business code.
Improves testability, configuration, and lifecycle management.
Side-by-side examples engineers can pattern-match during review.
PaymentService svc = new PaymentService(new HttpClient());class OrderHandler {
private final PaymentService payments;
OrderHandler(PaymentService payments) { this.payments = payments; }
}var repo = Factories.getRepo()new Handler(Repo repo)From the same buckets as this rule.
For changes that affect architecture, data models, external APIs, security posture, deployment topology, or cost (>10%), create an ADR in docs/adr/ using the standard template (Context, Decision, Consequences) and link the PR and issue IDs.