|
|
|
|
|
by radicalbyte
4917 days ago
|
|
In my experience, relational modelling works fine for domains containing simple logic. As soon as you start having constraints such as "from date must be before to date" and "the quote must have at least one line, and these lines should sum to > 0 and < 1000000" then relational modelling fails. Hard. I like to use a Quote with QuoteLines as an interview question. Relational modellers make two tables, both having unique identifiers. Domain modellers create two classes, sometimes exposing only one to the outside world. Only one of those classes (Quote) has an identity. Domain/class models tend, from what I've seen in the wild, to fail faster under load and under change. Ironically, experienced relational modellers tend to build cleaner class models. Although that might be more a function of experience than anything else.. |
|
In Postgres:
(This fails in MySQL. MySQL parses check constraints without error, but ignores them.)I don't understand the quote problem, so I won't attempt to model it.