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}