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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:03:34+00:00 2026-06-17T20:03:34+00:00

Root entity can pass transient references to internal entities to external objects , but

  • 0

Root entity can pass transient references to internal entities to external objects, but under the condition that external objects don’t hold on to that reference after an operation is completed

1)

a) Why is it acceptable for external object having a reference ( to an internal entity ) for the duration of a single operation, but not acceptable for it to hold on to that reference for a duration of two operations? My point being, if it’s bad to hold on to a reference for the duration of two operations, then it’s probably equally bad to hold on to it for a duration of a single operation?!

b) Assuming SomeRootEnt Aggregate root passes transient reference of internal entity SomeIntEnt to external object, how should external object request SomeIntEnt? By invoking a particular method on a root – e.g. SomeRootEnt.BorrowMeIntEnt(...) – or should root directly expose internal entity as its property ( e.g. SomeRootEnt.SomeIntEnt )?

2)

a) Assuming SomeRootEnt root passes a reference to internal entity SomeIntEnt to external object, which in turn makes some modifications on SomeIntEnt, then doesn’t this mean that root has no way of applying the appropriate invariant logic on those modifications ( ie root can’t check for the integrity of modified SomeIntEnt?

b) Similarly, to my understanding at least, root also has no way to force the external object to drop a reference to internal entity after the completion of a single operation?

Thank you

UPDATE:

2a)

That is correct, which is why it is best to ensure that the passed
object isn’t modified, but is used in an immutable way. Moreover, the
passed entity can still maintain a degree of integrity on its own.

Would it be primarily the responsibility of Aggregate root (and partly by passed entity) or of an external object ( which receives the transient reference ) to ensure that passed entity isn’t modified? If the latter, then isn’t the consistency of this aggregate really at the mercy of whoever developed the external object?

2b)

Correct and it is your responsibility to ensure this. Just like you
have to ensure that a give value object is immutable (if needed) you
have to consider the integrity of passed references.

I assume in most cases it would be the responsibility of external object to get rid of the reference as soon as an operation is completed?

  • 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-06-17T20:03:35+00:00Added an answer on June 17, 2026 at 8:03 pm

    1a) A reference to an entity may be needed to support a domain operation, however that reference should be transient in that it isn’t held after the operation. It is only held only for the duration of the operation, not after it and therefore it does not follow by induction that it can hold for two operations. The point of this is to ensure that the aggregate, which passed the reference to an external entity, can maintain control of its constituents. You don’t want its internal entities to be taken over by some other aggregate because then it is more difficult to reason about behavior.

    1b) It can go either way, depending on the use case. A property is just a method in disguise.

    2a) That is correct, which is why it is best to ensure that the passed object isn’t modified, but is used in an immutable way. Moreover, the passed entity can still maintain a degree of integrity on its own.

    2b) Correct and it is your responsibility to ensure this. Just like you have to ensure that a give value object is immutable (if needed) you have to consider the integrity of passed references.

    Most of this is a general guideline because it results in a “well-behaved”, easy to reason about, and easy to make consistent aggregates.

    UPDATE

    2a) Given the limitations of programming languages, there are limits to how well an aggregate can protect itself. As a result, “human intervention” is required, especially in more complicated scenarios like this one. It is true that the aggregate may come to be at the mercy of another, which is why these guidelines are in place.

    2b) Yes. The external object can make use of an internal entity of another aggregate, however it reference should be transient – meaning that it is not persisted.

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

Sidebar

Related Questions

I am aware that you can use {alias} to refer to the root entity
The root of the problem for me is that Java does not allow references.
How would I create this... <!DOCTYPE root-element[ <!ENTITY % w3centities PUBLIC -//W3C//ENTITIES Combined Set//EN//XML
Say I have entities organized in a hierarchy with Parent being the root entity
I have a DataImportHandler for importing data from a SQL database. The root entity,
The root of my question is that the C# compiler is too smart. It
My root problem is that when using calls Dispose on a StreamWriter , it
I have the following JOINED inheritance root entity for geographic areas (like continents, countries,
How can I use dynamic entity names in a controller action, in Zend framework
In JavaScript is Object the root of all entities or Function is the root?

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.