You can still use a factory method in case you need validation. Letting the data class validate it's content makes sense.
Like EmailAddress.parse and then make the constructor private.
@ursus
w
wasyl
09/12/2019, 5:08 PM
I think the point is that constructor is still exposed by