3 ms·
> could produce much better results by focusing your energies on learning the database instead of learning hibernate. Completely false IME. If you put the same
by lmm 3y ago
> could produce much better results by focusing your energies on learning the database instead of learning hibernate.
Completely false IME. If you put the same amount of effort into learning Hibernate you'll get a much bigger return.
- krzyk 3y agoIs there a way to avoid anemic domain model? Or have a proper invariant entity class that is created using constructor?
- lmm 3y agoNo. I see that as a reflection of the reality of the database; if your database contains rows that violate your domain invariants, what would you expect to happen?
- ivan_gammel 3y agoIt may not be a bad idea to fail fast by ORM calling the constructor (same way as Jackson does it when parsing JSON). Broken invariants may propagate and cross system boundaries making things much worse (I have seen a case, when $200M transaction was rolled back in 19 systems because data was not properly validated at entry - it was a crazy day for everyone in production support).
- krzyk 3y agoI hope application to break as soon as possible so everyone will be on board to fix it.