Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
interface Repository {
// db:
fun select(id: Int): SoftwareEngineer?
fun insert(engineer: SoftwareEngineer)
// api:
fun get(id: Int): SoftwareEngineer?
fun post(engineer: SoftwareEngineer)
}
class LocalEngineersCache : Repository {
override fun select(id: Int): SoftwareEngineer? {
// actual implementation
}
override fun insert(engineer: SoftwareEngineer) {
// actual implementation
}
override fun get(id: Int): SoftwareEngineer? {
throw UnsupportedOperationException()
}
override fun post(engineer: SoftwareEngineer) {
throw UnsupportedOperationException()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment