O'Reilly logo

JavaScript Domain-Driven Design by Philipp Fehre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing the application's lifecycle

Entities and aggregations are all about managing this cycle at every level of the application. We can think about the application itself being the aggregation wrapped around all its components to manage the attached value objects and contained entities. At the level of our prisoner transfer, we treat the transfer itself as a transaction wrapping all the local dependents, and managing the eventual result of either a successful transfer or a failed one.

It is always possible to push the lifecycle management further up or down the chain of objects, and finding the right level can be hard. In the previous example, the assignment might as well be a value object managed by an aggregate up the chain to ensure its constraints ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required