Blog icon indicating copy to clipboard operation
Blog copied to clipboard

Implementation of the application layer

Open ParsaMehdipour opened this issue 1 year ago • 1 comments

Can I assist in implementing the application layer? This way, our controllers can utilize application services instead of directly accessing repositories, thereby shifting the dependency from the infrastructure layer to the application layer

ParsaMehdipour avatar Jul 11 '24 01:07 ParsaMehdipour

That is a fair point - there are already a lot of "Service" folders in the Web Project. The idea is that, if you have a feature "XYZ" then there should be "XYZ/Services" to contain that logic. If that stuff is shared across multiple features, it should reside in the "root" Service folder.

I guess you have a specific use case in mind, don't you?

linkdotnet avatar Jul 11 '24 06:07 linkdotnet

I was considering implementing it as a best practice, though the project's scale is a crucial factor. The positive aspects I envision for incorporating an application layer include:

Better separation of concerns Easier maintainability I would love to hear your thoughts on this

ParsaMehdipour avatar Jul 11 '24 16:07 ParsaMehdipour

I was considering implementing it as a best practice, though the project's scale is a crucial factor. The positive aspects I envision for incorporating an application layer include:

Better separation of concerns Easier maintainability I would love to hear your thoughts on this

Sorry, my question was misleading. I did grasp the general idea behind that. I would love to know your concrete use case in mind - you said you want to access/expose something via controller that is currently internal logic of one of the Blazor components.

I am a bit reluctant to introduce a whole new layer. The current goto is to move stuff into the services. There isn't much "business" logic going on to be honest. I was also thinking of removing the Blog.Domain project at one point, as it doesn't really bring much of benefit to the table.

linkdotnet avatar Jul 12 '24 05:07 linkdotnet

Don’t mention it, mate. Your question was spot on. I agree with you that adding a new layer just to implement a best practice is unnecessary. I wasn’t considering a new use case scenario, but now that you’ve mentioned it, I’ll think about one. If I come up with a fantastic use case, I’ll let you know via issues.

ParsaMehdipour avatar Jul 12 '24 22:07 ParsaMehdipour