voddan
05/10/2016, 3:00 PMOrder
class fits very nice with data classes, IMO
the thing is that I would write it slightly differently:
data class Order(val id: String) {
var delivered: Boolean = false
}
This version is closer to the domain, since one never creates a delivered order anyway.
That way all the current features of data classes (except for toString
maybe) work nicely together to the desired result