Repository

The repository pattern is used to create a layer between database operations and our business logic. It is one popular pattern used to create enterprise level applications. It restricts us to directly performing operations on the database and helps us to test the code. 

The following is the hierarchy of MessageRepository, which handles the operations to the database:

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.