All challenges
Multiple ChoiceHard 45s

Rich model invariant

A rich Order model that rejects shipping an empty order best demonstrates:
Options
  1. 1An anemic model that keeps every bit of business logic outside in a separate service
  2. 2A DTO validation layer that checks the incoming fields before they ever reach the domain
  3. 3A database constraint that does all of the work of enforcing the rule at the storage tier
  4. 4Encapsulating an invariant inside the domain object so invalid states are unrepresentable

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle