API Design — Temporal Coupling
Zak Taccardi
782

Agree. Tack this on to your bonus…

class GoodApi(private val url: String) {

fun login(credentials: GoodApiCredentials) {
        // ... network call
    }
}
class GoodApiCredentials(private val username: String, private val password: String) {
    // validations, encoding, decoding, etc...
}
Show your support

Clapping shows how much you appreciated Erik Zettersten’s story.