Implementing Domain-Driven Design and Transactions

Henrik Olsson

I am confused about at least one thing after reading Vaughn Vernon's Implementing Domain-Driven Design. In Chapter 12 Repositories he says that transactions are managed in the application layer. But he also says that an aggregate is synonymous with transactional consistency boundary. And since repositories provide global access to aggregates, why couldn't transactions be managed in repositories? Is it because the rule aggregate == transactional consistency boundary is only a rule of thumb that must sometimes be broken, or is there something else to it?

guillaume31

why couldn't transactions be managed in repositories?

Because a Repository isn't an abstraction for "a business transaction", a Repository is an abstraction for "a collection of domain objects that you can take from or add to".

By definition, a transaction has a beginning and an end. It is a process. A Repository isn't. The relationship between Transaction and Repository is not is-a, it's has-a. The transaction uses its repository.

When we say that Aggregate should be the consistency boundary, we mean that it should be the only block of state encompassed by a transaction, not that an Aggregate should be the same thing as a transaction.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Implementing Domain Driven Design Cost

From Dev

Implementing Domain Driven Design Cost

From Dev

Implementing Paging and Sorting with Domain Driven Design

From Dev

Implementing Domain Driven Design Book Confusion

From Dev

Database Transactions in Application Services as defined by Domain-Driven Design

From Dev

Domain Driven Design for Rails App: Implementing a service in a basic example

From Dev

Layers in Domain Driven Design

From Dev

Domain Driven Design - Domain or Security

From Dev

Can you reference other aggregates in a factory when implementing domain driven design?

From Dev

Implementing multiple users within Identity and Access Bounded Context in Domain Driven Design

From Dev

Access Control in Domain Driven Design

From Dev

Domain Driven Design and batch processing

From Dev

Domain Driven Design Bounded Context Domain Objects

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Domain Driven Design. Entity type design

From Dev

Domain driven design repository implementation in infrastructure layer

From Dev

Domain Driven Design in Node.js Application

From Dev

Fetching associated aggregates in Domain driven Design

From Dev

Domain Driven Design - CQRS + ES usage

From Dev

Where is the call to persistence in the domain driven design

From Dev

Domain Driven Design (DDD) and database generated reports

From Dev

Domain-Driven-Design Entities and Value Objects

From Dev

Proper way to get aggregates in Domain Driven Design

From Dev

Domain Driven Design Auto Incremented Entity Key

From Dev

Fetching associated aggregates in Domain driven Design

From Dev

Where to find Domain Driven Design consultants?

From Dev

How to add scheduled jobs in domain driven design

From Dev

How to handle Domain Driven Design when domain is dynamic / changes

Related Related

  1. 1

    Implementing Domain Driven Design Cost

  2. 2

    Implementing Domain Driven Design Cost

  3. 3

    Implementing Paging and Sorting with Domain Driven Design

  4. 4

    Implementing Domain Driven Design Book Confusion

  5. 5

    Database Transactions in Application Services as defined by Domain-Driven Design

  6. 6

    Domain Driven Design for Rails App: Implementing a service in a basic example

  7. 7

    Layers in Domain Driven Design

  8. 8

    Domain Driven Design - Domain or Security

  9. 9

    Can you reference other aggregates in a factory when implementing domain driven design?

  10. 10

    Implementing multiple users within Identity and Access Bounded Context in Domain Driven Design

  11. 11

    Access Control in Domain Driven Design

  12. 12

    Domain Driven Design and batch processing

  13. 13

    Domain Driven Design Bounded Context Domain Objects

  14. 14

    Domain Driven Design: infrastructure concern or domain concern?

  15. 15

    Domain Driven Design: infrastructure concern or domain concern?

  16. 16

    Domain Driven Design. Entity type design

  17. 17

    Domain driven design repository implementation in infrastructure layer

  18. 18

    Domain Driven Design in Node.js Application

  19. 19

    Fetching associated aggregates in Domain driven Design

  20. 20

    Domain Driven Design - CQRS + ES usage

  21. 21

    Where is the call to persistence in the domain driven design

  22. 22

    Domain Driven Design (DDD) and database generated reports

  23. 23

    Domain-Driven-Design Entities and Value Objects

  24. 24

    Proper way to get aggregates in Domain Driven Design

  25. 25

    Domain Driven Design Auto Incremented Entity Key

  26. 26

    Fetching associated aggregates in Domain driven Design

  27. 27

    Where to find Domain Driven Design consultants?

  28. 28

    How to add scheduled jobs in domain driven design

  29. 29

    How to handle Domain Driven Design when domain is dynamic / changes

HotTag

Archive