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 6597935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:16:25+00:00 2026-05-25T18:16:25+00:00

I have been using DDD for a while know so I am comfortable with

  • 0

I have been using DDD for a while know so I am comfortable with the idea of aggregates. At first I did have troubles wrapping my head around not using/persisting references to other root aggregates but I think I’m on board… so:

  • Storing a root aggregate as a one document…. check
  • Using denormalized references containing properties that do not change or rarely change…. check

For the times that I DO want to have a full reference to another root aggregate, I understand it is recommended that I persist a reference to its ID and can use the RavenDB client API’s Includes to retrieve all the entities efficiently.

That handles the data part, what I haven’t seen is the best way to handle this in my entity class:

  1. Have both Product and ProductId properties in my class using [JsonIgnore] on the Product to ensure it doesn’t get persisted with the document.
    • The full object graph could then be glued back together in the repository (using API’s Includes for efficiency) or I could inject a service into the entity that would fetch Product lazily (possible N+1 hit)
  2. Glue it back together in a ViewModel. I don’t like this idea as I could end up with an unexpected NULL reference in the domain if not used correctly.
  3. Some other obvious way that I’m not seeing?

Thoughts?

  • 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-25T18:16:25+00:00Added an answer on May 25, 2026 at 6:16 pm

    In DDD there are at least two valid points of view. Some ppl link root aggregates only by ID or another valid key and second is using platform specific references to other objects. Both has it’s own pros and cons.

    With NoSql solutions like RavenDb, it’s probably better to use first approach, because second is just technically wrong.

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

Sidebar

Related Questions

We have been using CruiseControl for quite a while with NUnit and NAnt. For
We have been using Scrum for around 9 months and it has largely been
I have been using C# for a while now, and going back to C++
I have been using Ruby for a while now and I find, for bigger
I have been using IoC for a little while now and I am curious
I have been using Repository pattern (DDD and POEAA) for some time. However some
I have been using mod_rewrite for a while and love it. However, I am
I have been using MSSQL 2005 with Rails for quite a while now, and
I have been using PHP and JavaScript for building my dad's website. He wants
I have been using Eclipse as an IDE for a short amount of time

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.