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

Can Infrastructure layer reference direct a class on Domain layer? #224

Open
leandrofagundes opened this issue Aug 13, 2020 · 2 comments
Open

Comments

@leandrofagundes
Copy link

Hey @ivanpaulovich,

Following this image here:
https://github.com/ivanpaulovich/clean-architecture-manga/wiki/Separation-of-Concerns#separation-of-concerns

Can my Infrastructure project reference my Domain project or should it reference my Application (UseCases) project?
Should factories be inside the domain (ICustomerFactory) or should it be part of Application?

@SViradiya-MarutiTech
Copy link

I yhink domain should not have interfaces

@leandrofagundes
Copy link
Author

leandrofagundes commented Sep 20, 2020

Hi @SViradiya-MarutiTech and thanks for your comment.
All my entities are abstract and implement interfaces. What is an interface besides an abstraction?
I'm not sure if factories and repositories contracts should be on Domain or not, but I'm using it on Domain since I started separating my Application project by contexts.
I don't have an Application project with all my UseCases, but I have 1 application project for Admin WebSite with all the use cases for Admin usage. I have another application project for Customer WebSite with all the use cases for customer's usage. Each application has your use cases and services, DI and IoC but both use the same repositories and factories, so, I share them putting my contracts on Domain project (since my entities are equals in both contexts, Admin and Customers APIs).

Again, it's all my opinions and I'm not sure if it's right.

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

2 participants