Comments (4)
In this example the aggregates are implied rather than explicit via interfaces. A matter of preference I suppose.
The domain layer is the heart of the software, and this is where the interesting stuff happens.
There is one package per aggregate, and to each aggregate belongs entities, value objects, domain events,
a repository interface and sometimes factories.
from dddsample-core.
The getters listed allow for private setters.
- Location may only be set in the ctor.
- Delivery is set in either the ctor or via
specifyNewRoute()
.
This pattern relates to anti-corruption of the domain model.
from dddsample-core.
In this example the aggregates are implied rather than explicit via interfaces. A matter of preference I suppose.
The domain layer is the heart of the software, and this is where the interesting stuff happens. There is one package per aggregate, and to each aggregate belongs entities, value objects, domain events, a repository interface and sometimes factories.
I see, thanks very much!
from dddsample-core.
The getters listed allow for private setters.
- Location may only be set in the ctor.
- Delivery is set in either the ctor or via
specifyNewRoute()
.This pattern relates to anti-corruption of the domain model.
specifyNewRoute()
is ok. But here( application layer),
CargoInspectionServiceImpl.java:
public class CargoInspectionServiceImpl implements CargoInspectionService {
// ...
if (cargo.delivery().isMisdirected()) {
applicationEvents.cargoWasMisdirected(cargo);
}
if (cargo.delivery().isUnloadedAtDestination()) {
applicationEvents.cargoHasArrived(cargo);
}
// ...
}
is the following approach bad? (Law of Demeter, Encapsulate logic to the target object)
public class CargoInspectionServiceImpl implements CargoInspectionService {
// ...
cargo.misdirectedIfNeeds(); // and publish event in domain
// ... or
if (cargo.isUnloadedAtDestination()) { // should application know delivery?
applicationEvents.cargoHasArrived(cargo);
}
// ...
}
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
- 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.