Repository Pattern

Mediate between domain and data mapping layers

Overview

The Repository pattern acts as an abstraction over the data access layer. It hides the complexity of database operations and exposes domain objects rather than database records.

Code Example

java
1public interface UserRepository {
2    User findById(Long id);
3    void save(User user);
4}

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In
Repository Pattern - Additional Patterns | LLD | Revise Algo