January 2018
Intermediate to advanced
414 pages
10h 29m
English
First, we will create a service interface. We could do this in IntelliJ by right-clicking in our package and selecting a new Kotlin File | Class and then choosing Interface in the drop-down. We will be naming it CustomerService.
We will define the methods that our service will need:
package com.microservices.chapter3interface CustomerService { fun getCustomer(id: Int) : Customer? fun createCustomer(customer: Customer) fun deleteCustomer(id: Int) fun updateCustomer(id: Int, customer: Customer) fun searchCustomers(nameFilter: String): List<Customer>}
These operations don't expose how customers are stored/saved or searched, they are purely the interface that we like to have and are not exposing anything internal ...
Read now
Unlock full access