Am I allowed to have “incomplete” aggregates in DDD?

前端 未结 5 614
再見小時候
再見小時候 2021-02-05 10:04

DDD states that you should only ever access entities through their aggregate root. So say for instance that you have an aggregate root X which potentially has a lot of

5条回答
  •  礼貌的吻别
    2021-02-05 10:41

    Jimmy Nilsson hints in his book that instead of reading a complete aggregate you can read a snapshot of parts of it. But you are not supposed to be able to save changes in the snapshot classes to the database.

    Jimmy Nilsson's book Chapter 6: Preparing for infrastructure - Querying. Page 226.

    Snapshot pattern

提交回复
热议问题