angarron03/06/2017, 10:19 PM
Ruckus03/06/2017, 10:22 PM
may be a great option for a data class. But performing logic on objects to derive the data that goes into the class isn't the responsibility of the data, and thus not the responsibility of the data class's constructor. That code would be better suited in a function, possibly on the companion object. The constructor of a data class should just take the data it's meant to carry.
angarron03/06/2017, 10:27 PM
on any class as those are somewhat time-consuming to write (and easy to forget to change if you add a new field), but as you have mentioned, sometimes you wanna do things during initialization that go beyond the scope of what a data class typically wants to do.
that you showed me to have something of a virtual constructor. So I am very satisfied overall 🙂 and again, huge thanks!!)
operator fun invoke
Ruckus03/06/2017, 10:36 PM
angarron03/06/2017, 11:35 PM