Is that conceptually a good use of a data class? I...
# announcements
s
Is that conceptually a good use of a data class? I’ve written them with methods in them but typically limit the methods to adding extra meaning to the data like isExpired or fullName methods/properties.
z
Would you rather just expose the underlying data structure (so a public map in this case), and have consumers of the data class read it directly?
y
I wouldn’t. encapsulating the underlying data structure is always a good idea