Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于防腐层SalersService放置在infrastructure模块的疑问 #2

Open
dengxiangjun opened this issue Aug 9, 2019 · 2 comments

Comments

@dengxiangjun
Copy link

比较了下楼主的单模块与多模块示例,在多maven模块示例中,如果防腐层的SalersService的方法需要传domain的聚合根对象,那么infrastructure就需要依赖于domain模块,而现在domain已经依赖了infrastructure模块了,这样的话不就循环引用了吗?

@dengxiangjun dengxiangjun changed the title 关于防腐层SalersService 关于防腐层SalersService放置在infrastructure模块的疑问 Aug 9, 2019
@Sayi
Copy link
Owner

Sayi commented Aug 12, 2019

Hi,@dengxiangjun 多模块infrastructure依赖了domain,单模块domain依赖了infrastructure,其实在单模块中可以改成不依赖的,domain里面写接口,实现在基础设施层。

@Jays769
Copy link

Jays769 commented Sep 13, 2021

其实在单模块中可以改成不依赖的,domain里面写接口,实现在基础设施层。

确实有必要改成这样,不然第一次看很困惑;那么问题来了,这个接口该放哪里,放domain service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants