All challenges
Multiple ChoiceBeginner 45s

Aggregate root: external access rule

According to DDD, how should code outside an aggregate reference entities that are not the aggregate root?
Options
  1. 1By holding direct object references to any entity. The caller keeps a pointer to that entity.
  2. 2By copying the entity into a DTO and modifying it. The modified copy goes back to the aggregate.
  3. 3It should not; only the aggregate root may be referenced externally, by identity
  4. 4By publishing it as a public field. Any caller can read and mutate it without the root.

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