Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6045769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:09:42+00:00 2026-05-23T07:09:42+00:00

I’m trying to get a handle on DDD and feel that I’ve got a

  • 0

I’m trying to get a handle on DDD and feel that I’ve got a pretty good grasp regarding entities, aggregates, aggregate roots, repositories and value objects and how to actually represent these concepts in code.

What I’m still struggling with is how to represent references (i.e relations that don’t make up an aggregate) in actual code. Let’s say I have the two following aggregates

DISCUSSIONGROUP (entity, aggregate root)
 +name: string
 +ENTRY (entity)
   +title: string
   +message: string
   +timestamp: date
   +madeByUser: USER

USER (entity, aggregate root)
 +name: string
 +email: string
 +memberOf: DISCUSSIONGROUP

A user can be a member of a discussion group but the user entity don’t belong in the same aggregate. There is still however a relation between the two (a reference). When looking at actual code, I would implement aggregate relations such as (using C#):

interface IDiscussionGroup {
    string Name { get; }
    IList<IEntry> { get; }
    ...
}

I.e using simple C# references. Would you implement DDD references (as described above) i the same manner, i.e:

interface IUser {
    IDiscussionGroup MemberOf { get; }
    ...
}

of should one use some other construct to indicate the weaker type of relation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:09:42+00:00Added an answer on May 23, 2026 at 7:09 am

    Really it depends on your requirements. There is no one way of doing it well but what I would do is to make a madeByUser property in DISCUSSIONGROUP entity a ValueObject.

    Why ? Because when displaying Entries from DisscusionGroup I’m rather interested about the name and maybe email of the user to display on the entry. I don’t want that user disapears on my entry when it’s deleted from the database. If the User entity had more properties and behaviours, I’m not interested in that when displaying user information for example so the ValueObject will be fine. More, you can share that VO between many entries without retriving the instance of concrete User for each entry.

    On the other hand is User aggregate used in the same context as the discussionGroup ? What I mean that the DiscussionGroup could be an Entity in one context (for example in the Front-office use case) and a value object in user managment backoffice (we’re not interested in managing disscussion groups but the users only, so a simple information about disscussiongroup is sufficient). However you may want to have a reference from DisscussionGroup entity to User entity or make also a DiscussionGroup a VO in that case. Do you need to retrieve all discussionGroups and entries for a given user ? Or you need just a few information that you could embeded in a Value Object?

    I’m sorry if I didn’t answer your question very well but doing a direct references or just using some kind of shared Id between the aggregates or using VO depends really on the uses cases and the behaviour you have to implement.

    Personnaly I check if I definied a good aggregate boundaries if I can retrieve all data in the aggregate without doing Lazy Loading and other stuf like this.

    Maybe others have another point of view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.