Implementing data repositories

You are already familiar with repositories, so there is no need for an introduction to them. The repositories we are about to create are similar to those created for the Messenger API in Chapter 4, Designing and Implementing the Messenger Backend with Spring Boot 2.0. The only difference is that the data source for the repositories we are about to implement is a remote server, not a database residing on a host.

Create a repository package within the remote package. First and foremost, we are going to implement a user repository to retrieve data pertaining to application users. Add a UserRepository interface to the repository, as follows:

package com.example.messenger.data.remote.repositoryimport com.example.messenger.data.vo.UserListVO ...

Get Kotlin Programming By Example 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.