Comments (4)
IMO the advice was not in the context of using an ORM, it was about not having a endlessly inter-connected domain model. By holding entire reference I can potentially traverse the entire object graph which is not great. Nevertheless thanks for sharing this implementation.
from dddsample-core.
Idea behind aggregates is not to avoid references to roots outside aggregate. But avoid references to non-root entities/value-objects outside aggregate.
Cargo and Location are roots in their aggregates, so they used for references. But for example you don't find references for Delivery in any other aggregates beside Cargo.
Look at domain folder structure where are four directories representing aggregates: cargo, handling, location, voyage.
I think you just miss that Location is aggregate root.
from dddsample-core.
Thanks for the quick reply. One of Vaughn's rules/suggestions is
Rule: Reference Other Aggregates By Identity
Check page 2 of Part 2 Aggregate Design
from dddsample-core.
I believe in the book it is recommended to reference other aggregates by identity and do retrieval through a repository.
This prevents you from say accidentally saving a new location entity while saving a cargo object by an implication of how your ORM is configured.
from dddsample-core.
Related Issues (20)
- Redirect Sourceforge website to Github Pages website HOT 1
- Clearer and more isolated aggregates HOT 1
- Add scenario/integration test HOT 1
- Set up a version running in the cloud HOT 1
- Add a CODEOWNERS file HOT 1
- Infrastructure layer depending on domain layer and interface declarations HOT 3
- Update to Spring Boot 3
- Package by feature, not layer HOT 1
- Some spell fault HOT 2
- Why is xxxRepository class in model package, I think xxxRepository should be a separate package, can you explain your understanding plz? :) HOT 1
- mvn spring-boot:run CommandAcceptanceException HOT 2
- Isn't it a problem that you add entities to an aggregate from a different aggregate? HOT 9
- Document project history HOT 2
- Class under the domain/model path is "Anemia model"? HOT 4
- demo中的小瑕疵
- How to build and run this in IntelliJ Idea HOT 1
- Requirements HOT 1
- Error sending handling event SOAP message HOT 1
- Coupling to ORM HOT 2
- Date parsing failure when assigning cargo to route HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dddsample-core.