开发者

Domain Driven Design Aggregates

开发者 https://www.devze.com 2023-01-18 23:14 出处:网络
Can someone please clarify the following; if a have the following model; presentation-->slide-->video where I have identified presentation as the aggregate root, does this mean that if I want to ad

Can someone please clarify the following;

if a have the following model;

presentation-->slide-->video

where I have identified presentation as the aggregate root, does this mean that if I want to add a slide to a presentation then I must go through the aggregate root e.g. presentation.add开发者_运维知识库slide(slide myslide) and in a similar fashion if I want to add a video to a slide I also have to go through the aggregate root e.g. presentation.addvideotoslide(video myvideo, int slideNumber)???

Or can I use the slide outwith the presentation and have a method on the slide e.g. slide.addvideo(video myvideo)???

Thanks


Your first assumption is correct, you are supposed to go through the aggregate root to access value objects and entities contained within the aggregate.

0

精彩评论

暂无评论...
验证码 换一张
取 消