DEV Community

Discussion on: Clean Architecture Essentials

Collapse
 
eladchen profile image
Elad Chen • Edited

So.. output ports implementations (such as CloseAccountPresenter below) are aware of the domain layer / objects that reside two layers down?

CloseAccountUseCase.cs#L75-L77
CloseAccountPresenter.cs#L27-L28
CloseAccountOutput.cs#L25

I was under the impression that a layer should only
be dependent on the next layer?

Collapse
 
ivanpaulovich profile image
Ivan Paulovich

Hi @eladchen ,

Thanks for the input. On my design a prioritized that "when we pass data across a boundary, it is always in the form that is most convenient for the inner circle." blog.cleancoder.com/uncle-bob/2012...

Considering this I pass domain objects to the Presenter methods as arguments then it is responsible to generate the visualization for each case. I did differently in the past using concrete output objects in the application layer but the conversions didn't payout in the end.

I need to empathize that I follow the general rule to not to expose Domain objects on REST APIs.

Collapse
 
eladchen profile image
Elad Chen

Awesome - This has been a real pickle, I'm glad to know that didn't pay out.