Repository Pattern
Noun · Development
Definitions
A design pattern that mediates between domain logic and data mapping layers, providing a collection-like interface for accessing domain objects. The repository abstracts the data source — business logic calls userRepo.findByEmail() without knowing whether it queries SQL, an API, or an in-memory store. Enables easy mocking in tests.
In plain English: An abstraction layer that hides where data comes from, so business code just asks for objects without knowing about the database.
Example: "The UserRepository interface has findById, save, and delete — the PostgresUserRepository implements it, but tests use an InMemoryUserRepository."