# Repository: Ask for the Book, Not the Shelf

When the checkout service talks to the database in the database's own words (tables, rows, columns, dates stored as text), every class that needs loans copies that code, tests need a database, and a new database means editing them all; a repository puts loans behind one interface in the app's own words, so a class asks for a loan and never learns where it's kept.

![Cheat sheet: Repository: Ask for the Book, Not the Shelf](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/0a1963887bcc4106a47a87151dcb7778.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Dependency Inversion Principle, Interface, OOP, Repository Pattern, software-development
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-repository-cheat-sheet
