Domain driven design and transactions in Spring environment

后端 未结 4 1210
-上瘾入骨i
-上瘾入骨i 2020-12-24 02:50

I used to design my application around anemic domain model, so I had many repository object, which were injected to the big, fat, transaction-aware service layer. This patte

4条回答
  •  無奈伤痛
    2020-12-24 03:36

    Unnfortunately I haven't make myself familiar with Spring but I will give feedback about your DDD understanding. Reading your description of transaction it is obvious that you haven't understand DDD especially Aggregate, Aggregate Root, and Repository concept.

    In DDD transaction can't span across aggregates so one Aggregate will always have one transaction.

提交回复
热议问题