Domain-Driven Design – Multiple uses of the same entity


Currently we are designing a system where a user can comment on several topics. The subject can be an image, a post, and so on. A comment should be editable and erasable. It would only contain text (for the time being). A comment can only be inserted if the subject allows it. At first glance, I would model it as follows:

| Comment (AR) |
| - Subject |
| - Text |

| Subject (VO) |
| - PictureID |
| - PostID |

The problem, however, is that the commenting service needs to know if the user is allowed to comment on a specific image or post (depending on the privacy settings, for example) before it can be added. So it needs to know about the subject models. Also the sentence A user can comment on a post OR a picture I wonder if the comment itself should be an AR. Would the comment not be a summary of the root aggregates Picture and Post? Like this:

| Contribution (AR) |
| CommentIDs[] |
| ...

| Picture (AR) |
| CommentIDs[] |
| ...

| Comment (AR) |
| - Text |

However, pasting the comments into "Post" and "Picture" would blow up these aggregates and create huge trx boundaries as big discussions begin. I am a bit lost here and circle between these two models again and again.