Giter VIP home page Giter VIP logo

Comments (4)

wtjones avatar wtjones commented on July 26, 2024 1

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.

The domain layer is the heart of the software, and this is where the interesting stuff happens.

from dddsample-core.

wtjones avatar wtjones commented on July 26, 2024

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.

johnlee175 avatar johnlee175 commented on July 26, 2024

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.

The domain layer is the heart of the software, and this is where the interesting stuff happens.

I see, thanks very much!

from dddsample-core.

johnlee175 avatar johnlee175 commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.