|
|
|
|
|
by ninkendo
3007 days ago
|
|
IMO the constraints should be as close to the thing that needs the data, as possible. Your object is an expression of data that may be valid in some contexts and invalid in others, and trying to pick any one of them is difficult (and leads to things like complex inheritance trees to express all the different flavors of constraints.) I think this is the essence of the "composition over inheritance" idea that seems to be the most violated piece of sound OO advice out there. |
|