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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:00:00+00:00 2026-05-30T06:00:00+00:00

Can aggregate roots have childs which also is aggregate roots? If yes, does it

  • 0

Can aggregate roots have childs which also is aggregate roots? If yes, does it only reference it or does the aggregate root that holds a property of the other aggregate root have methods that changes it through that method?

Let say you have a class named “Worker” and another named “Company”. Both are aggregate roots. Company have a property of Worker. Sorry for making a bad example

public class Company {
    private Worker worker;

    ...

    public Worker getWorker() {
        ...
    }
}


public class Worker {
    ...
}

or does the company class “hide” the worker?

public class Company {
    private Worker worker;

    ...

    public String getWorkerName() {
        ...
    }
}


public class Worker {
    ...
}

And does worker talk only to the company class because it is not part of the company context? Why so? Are aggregate roots contained inside other aggregate roots always accessed like my first example? (I would think so, but I have no reason why)

  • 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-30T06:00:02+00:00Added an answer on May 30, 2026 at 6:00 am

    In short, no.

    This is kinda tough to explain succinctly in a SO answer, but here’s a few bullet points that may help your understanding:

    • An aggregate root is a consistency boundary. Basically, all the data that needs to be kept consistent belongs in the aggregate root. You’ll know it’s structured correctly when it has high cohesion – most methods touch a lot of private properties.
    • All interaction with an aggregate root or its children should be done via public methods on the aggregate root. In your example, if a Worker belongs to a Company then adding/removing a Worker or performing any operations on a Worker should be done via public methods on Company.
    • You can have entities below aggregate roots, but in my experience this is often a design smell. Most often in my experience, you have value objects as children of aggregates.
    • Correlation between aggregate roots is done via an ID, so Company may know about a GUID called WorkerId, but it definitely should not be coupled to the Worker class. (This will allow you to refactor more easily.)
    • You only need a domain model (and therefore aggregate roots) if an operation (i.e. a method) depends on the previous state of the data. If there’s no state changes involved, just do CRUD.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm struggling with aggregates and aggregate roots. I have a natural aggregate root which
I have an aggregate root which is a WallPost. A WallPost can have zero
If I have an aggregate root which consists of say: class Parent { IEnumerable<Child>
I have the need to persist a calculated property with an aggregate root. The
Can a LINQ enabled app run on a machine that only has the .NET
Assume that Book and Author are Aggregate Roots in my model. In read model
I have the following entities in my domain model. A group (an aggregate root)
If I have an Order class an as aggregate root and 1000 line items.
Say we have two aggregate roots in a domain model: Group and User. Now,
I have a simple examle domain of two aggregate roots and one regular entity.

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.