Currently we are designing a system where a user can comment on multiple subjects. Subjects can be a picture, a post, etc. A comment should be editable and deletable. It would just contain text (for now). A comment can only be placed if the subject allows it. On the first hand, I would model it as follows:
| Comment (AR) | | - Subject | | - Text | | Subject (VO) | | - PictureID | | - PostID |
However the problem is that the comment-service needs to be able to know whether the user is allowed to comment on a certain Picture or Post (depending on privacy setting, f.e). So it needs to know about the Subject entities. Also the sentence A user can comment on a Post OR a Picture makes me question whether the Comment should be an AR itself. Wouldn't this make the comment an aggregate of the root-aggregates Picture and Post? Like this:
| Post (AR) | | CommentIDs | | ... | Picture(AR) | | CommentIDs | | ... | Comment (AR) | | - Text |
But now, by putting the comments inside Post and Picture would blow up these aggregates and create huge trx-boundaries when big discussions start. I'm a bit lost here, and keep circling between these 2 models.