# Hand Me What I Need

Hand Me What I Need: Dependency Injection: Hand Me What I Need, Containers: Who Does the Handing Out.

Updated: November 17, 2026

1. [Dependency Injection: Hand Me What I Need](https://www.ask-codey.com/lessons/dp-dependency-injection) (Journeyman): When a class builds its own database and reads the real clock, nothing outside it can change either one, so its rules can't be tested; dependency injection has the class ask for them in its constructor, and whoever makes it hands them in, which finishes the idea Pass 1 started with the bakery's settings.
2. [Containers: Who Does the Handing Out](https://www.ask-codey.com/lessons/dp-di-containers) (Journeyman): Once every class asks for what it needs, someone has to make the parts and hand them out; doing it in one place at the start of the app (the composition root) keeps it from being copied everywhere, and a container automates that place, with lifetimes that say whether a part is made once for the app, once per request, or new every time.

Source: https://www.ask-codey.com/courses/design-patterns/topics/dp-hand-me-what-i-need
