|
![](/i/fill.gif) |
Le 19/11/2011 07:07, Darren New nous fit lire :
> I've been trying to introduce the team to the wonders of actually having
> the code and the data in the same class. :-)
Well, from the old relational database experience... they shouldn't.
At least, they shouldn't be too tighly coupled until the code is
specific to the data and the data are usable only by the code.
Have a SQL schema (data) and only stored procedures usually ends up in
nightmare.
Data should have their invariants and rules.
Code should be in charge of transforming the data with respect to the
rules and adding new pieces of data which also match the rules.
But you're right, having data in very distant classes from the ones
which have the code is also a PITA. (and from an isolation point of
view, the code classes should not be friend of data class, so no ugly
shortcuts...)
Post a reply to this message
|
![](/i/fill.gif) |