▲ | RossBencina 5 hours ago | |||||||||||||||||||||||||
Depending on the language, you can define a PasswordString type that is entirely distinct from the string type. Perhaps it can be explicitly converted to a string (perhaps given a capability token). Then you have: a { user_pw: PasswordString} This is what it means to model the domain using types. It is not a separate layer, it is actually using the type system to model domain entities. | ||||||||||||||||||||||||||
▲ | b_e_n_t_o_n 5 hours ago | parent [-] | |||||||||||||||||||||||||
Structurally typed languages can still support information hiding.
I guess the point is that you can model your domain using data as well as types. | ||||||||||||||||||||||||||
|