Domain driven design and transactions in Spring environment

后端 未结 4 1211
-上瘾入骨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条回答
  •  -上瘾入骨i
    2020-12-24 03:47

    My personal take on applying DDD with Spring and Hibernate, so far, is to have a stateless transactional service layer and access the domain objects through that. So the way I'm doing it the domain model does not know about transactions at all, that is handled entirely by the services.

    There is an example application you might find helpful to take a look at. It looks like Eric Evans was involved in creating it.

提交回复
热议问题