Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created February 7, 2021 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le0nidas/a429a9ebbc486f449ab9f0b0b829d344 to your computer and use it in GitHub Desktop.
Save le0nidas/a429a9ebbc486f449ab9f0b0b829d344 to your computer and use it in GitHub Desktop.
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