The "Software Architecture"
We usually see Software Architecture descriptions like "The software architecture is an ASP.NET Web API with...
For further actions, you may consider blocking this person and/or reporting abuse
Hi Ivan! I have a new question: What about if we need to consume an external api ? We need to create an interface IExternalService in the Application proyect, but where is the place to implement this interface? Infrastructure ? Thanks!
Hi @darianbenito ,
I had to take a long break from laptops last weeks and coming back to routine slowly. Let's see if I could clarify you:
In the Domain you design your Model putting your business logic in priority. Suppose your application gives you suggestions of what to do based on the local weather.
Later you write a weather provider:
Thanks again for reaching me out, I really appreciate feedback.
I hope this would give you insights.
Best,
Ivan
Thanks Ivan!
Hi Ivan, Thanks for share.
What about if we need to obtain all registers from a entity (GetAllEntityXBySomeProperty) to load a DropDownList ? We need to create a UseCase for it, right? Or we just call to the EntityXRepository (GetAllEntityXBySomeProperty method) from the UI ...
Let me shared a personal code:
Hey Darian,
Yes, for each interaction you need to create an use case. I implemented an use case similar to yours on Manga Project github.com/ivanpaulovich/clean-arc.... Checkout the branch "React" for the most up to date code.
BTW your use case implementation is missing a return after
outputPort.HandleError
. Let me know if you have more questions :)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?
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.
Awesome - This has been a real pickle, I'm glad to know that didn't pay out.
High value post, thank you. This is the high-level thinking sorely missed by most junior devs.
I appreciate the feedback 🍺! My goal is to make this content accessible to them.
Thank you so much for sharing this article.one day I would like to write a clean code like you
Thank you @sarjunan! There is no secret, study the Adaptive Code and the Clean Architecture books then practice it on your projects a little bit every day.
Bring your questions to me on GitHub or Twitter :)
Awesome post about Clean Architecture. Thank you so much.
I did not understand the utility of presenter class. I tought that the presenter class should wrap up multiple return types using generics. It so, it would map the use case output to the specific UI that requested the use case execution.
In your example, using the automapper would't do the job?