angarron
03/06/2017, 10:19 PMRuckus
03/06/2017, 10:22 PMRuckus
03/06/2017, 10:27 PMManageUserHelper
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.angarron
03/06/2017, 10:27 PMangarron
03/06/2017, 10:29 PMequals
, hashCode
, and toString
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.angarron
03/06/2017, 10:31 PMoperator fun invoke
that you showed me to have something of a virtual constructor. So I am very satisfied overall 🙂 and again, huge thanks!!)Ruckus
03/06/2017, 10:36 PMangarron
03/06/2017, 11:35 PM