C
C#5mo ago
corteZz-1

Question about clean architecture

I read article about clean architecture (in microsoft docs) and I have question about validation. In the article said that Application layer must not have any dependencies from external libraries and frameworks. But I see examples projects on github which build within clean architecture and many projects use fluent validation library in Application layer. So I have confusion, if sense of this architecture make independence application (and domain) layers from frameworks - why people do this?
14 Replies
i like chatgpt
i like chatgpt5mo ago
A good question. I am also interested to know the answer. In theory, Application layer should only depend on the Domain layer. But I see many people make Application layer also depend on third party libraries like MediatR and FluentValidation.
SwaggerLife
SwaggerLife5mo ago
@corteZz-1 @ABOUT ME explains my gameplay I personally wouldn't recommend clean architecture where you have multiple layers etc. Honestly it just complicates everything. I would recommend a feature based architecture.
SwaggerLife
SwaggerLife5mo ago
Instead of having multiple projects. You would do something likes this:
No description
SwaggerLife
SwaggerLife5mo ago
In this case, everything that has to do with Users is grouped as a feature. Let's say you also want to implement authentication than you just create another group or feature. This way everything is grouped together, there is no need to spend 10 minutes trying to find a file or class etc.
i like chatgpt
i like chatgpt5mo ago
Where do you put the Migrations folder? In a separate project?
SwaggerLife
SwaggerLife5mo ago
No description
SwaggerLife
SwaggerLife5mo ago
ignore the red underline lol. Let's say you have an entity that doesn't really belong to any feature. Just create a folder named Entities and store that entity inside there.
i like chatgpt
i like chatgpt5mo ago
Where is the Migrations folder?
SwaggerLife
SwaggerLife5mo ago
The Migrations folder would go right in the main Directory in this case the project. I just cloned the project from github. That's why I have the red-underlines. lol
i like chatgpt
i like chatgpt5mo ago
public repo?
SwaggerLife
SwaggerLife5mo ago
Believe me, I have tried the clean architecture approach. It's not worth it. Sadly not, it's a private project. If you need some more clearification I can maybe help you.
corteZz-1
corteZz-15mo ago
this approach called vertical slice architecture, you can search on github
jcotton42
jcotton425mo ago
$vsa is what we usually link here
MODiX
MODiX5mo ago
dotnet
YouTube
Vertical Slice Architecture: How Does it Compare to Clean Architect...
Is Vertical Slice Architecture the next big thing or just as cool new kid? Enterprise software development requires you to choose the right architecture. This session with Luke Parker will provide a realistic dive into Vertical Slice Architecture (VSA) with .NET; showcasing the potential shift from Clean Architecture (CA) to VSA. You will lear...
Derek Comartin
CodeOpinion
Restructuring to a Vertical Slice Architecture
What is Vertical Slice Architecture? It's about focusing and organizing code by features and capabilities, not technical concerns!