I am currently developing a DDD application and am confused about how to handle a scenario where it seems as if I have to access an aggregate root from another aggregate root. Here is an overview of my boundary contexts:
Users can join the site and create posts on topics they are interested in. They can also create groups and make posts specific to the group(s) they create or posts for all site members to see. Users can also upload a photo for their profile page for other to see or upload word documents and pdf files to associate with a post. A user can allow other user to join their group or make group invite only.
User (represents a member of the site)
Posts(a user can create many posts)
File(a user can associate an image to appear on their profile page; associate a word document or pdf with their post)
Group(a user can create any number of groups other users can join)
What is the proper approach to break this apart, I was thinking that each was an AR in this scenario?
It seems as if there is a FK repationship between User and the other AR in this scenario, should this association be represented in a Value object or AR?
Since the file AR seems to be connected to both User and Post in a FK type relationship, how should I represent this from AR's or Value objects?
One to many
User -> Posts
User -> File
User -> Group
One to many
Posts -> File