Skip to content

architectural implementation detail #2

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

Open
mstrYoda opened this issue Jun 27, 2019 · 1 comment
Open

architectural implementation detail #2

mstrYoda opened this issue Jun 27, 2019 · 1 comment

Comments

@mstrYoda
Copy link

I've saw that you directly reference infrastructure layer into api. Is not that there should be an abstraction between them? Like a ports&adapters or use case driven implementation which explained here :

https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/
https://herbertograca.com/2017/09/14/ports-adapters-architecture/

You already have an application layer which takes commands and process them via accessing infrastructure and domain. I think that it will be more accurate to abstract api from infra.

If you have any information like blog posts about "making api layer dependent on infrastructure is not a mistake & is acceptable", can you share it to me?

@paucls
Copy link
Owner

paucls commented Jun 28, 2019

In that example what I tried to do is separate Commands from Queries, that is the reason why the Controller is accessing directly the repository for the queries. That way the application services are only about use cases (actions).
Yes, I could make the UI not use the repository directly and access Projections or Queries.

The way I understand it API is not that different from the infrastructure, they are both external layers, inside the hexagon there are only 2 layers the uses cases and in the core the domain layer.

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