-
-
Save le0nidas/a429a9ebbc486f449ab9f0b0b829d344 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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