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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:12:43+00:00 2026-05-23T19:12:43+00:00

We are converting over a existing system to DDD and are struggling to wrap

  • 0

We are converting over a existing system to DDD and are struggling to wrap our head around a few concepts.

We have an aggregate root called Animal, which has properties such as Status and Source. Currently the database has two tables called StatusHistory and SourceHistory, which stores information about the animal when the status is changed. These tables sometimes have records deleted, and rarely need to be retrieved when getting an Animal from the AnimalRepository.

So the big question is where do they belong? Here are a couple of ideas we have:

  • Have them both as different entity objects as part of the animal aggregate. And have corresponding methods which allow them to be updated eg: Animal.UpdateStatus(newStatus), which would add to the collection with a new StatusHistory(this) object. But as mentioned above these are rarely required when get an existing animal for the repository, so we don’t wan’t the repository loading them. We are currently not using an ORM and are manually mapping using a table data gateway inside the repositories.

  • Make each of the history entities an aggregate root. We are not a fan of this , as it feel like we aren’t really modelling the domain and just drifting towards an Active Record Pattern. Also the task of updating these for the animal with have to lie outside of the animal entity.

  • We could try combining these histories into another aggregate root called AnimalHistory whose whole purpose is to maintain the history of the animal. But again it would be moving logic about storing the history into something other then the animal. Possibly a service like AnimalProcessingService, which feel like we might be heading toward an anemic design.

I’m hoping there is another option which will provide us with a much cleaner design.

  • 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-23T19:12:44+00:00Added an answer on May 23, 2026 at 7:12 pm

    This is an interesting article by Martin Fowler recently that might address some of your concerns about not needing some things on retrieval, called Command Query Responsibility Segregation. The basic concept is that you can use a different “model” for “query” (reading) than “command” (saving).

    http://martinfowler.com/bliki/CQRS.html

    Just because you are doing DDD doesn’t mean that everything needs to be contained in proper domain objects. Designing your domain is just as much about design of services and events, etc. My point in saying that is to let your domain come out more naturally by focusing on what the “domain” requires and what the solutions are to deliver those requirements. There is no strict methodology with DDD, it’s more of a choice in perspective than a formal design pattern. So having your history objects as entity roots isn’t necessarily bad if they are only really used in saving. Have your services related to “commands” compose the correct logic flow for saving animals and histories.

    I’d also like to point out that stuff like Animal.UpdateStatus(newStatus) is quite Active Record-ish, which you seemed like you wanted to avoid.

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

Sidebar

Related Questions

I am converting a personal site over to MVC 2 and I have been
I have a new client that I am converting over to Drupal from Wordpress.
I'm in the final stages of converting our site over to Graph API from
We are beginning to learn Android, converting our iPhone apps over. There is a
I am converting over to iOS 5 and storyboards. When I have a table
I have a dropdown list that I'm converting over to a custom modal dialog.
I am converting my company's VB6 program over to VB.net and I have hit
I have an existing ASP.NET web application that I'm converting to MVC 1.0. The
I am new to LINQ and have been asked to update our existing legacy
i am converting over from websforms to asp.net mvc and i have a question.

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.