-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class under the domain/model path is "Anemia model"? #50
Comments
The getters listed allow for private setters.
This pattern relates to anti-corruption of the domain model. |
In this example the aggregates are implied rather than explicit via interfaces. A matter of preference I suppose.
|
I see, thanks very much! |
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);
}
// ...
} |
Like:
class Cargo { public TrackingId trackingId() { return trackingId; } public Location origin() { return origin; } public Delivery delivery() { return delivery; } public RouteSpecification routeSpecification() { return routeSpecification; } }
Additional, I‘m newer, and I found Entity interface, why no Aggregate interface?
The text was updated successfully, but these errors were encountered: