C
C#•16mo 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
🥄feeders help me learn faster !
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.
v0fbu1vm
v0fbu1vm•16mo 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.
v0fbu1vm
v0fbu1vm•16mo ago
Instead of having multiple projects. You would do something likes this:
No description
v0fbu1vm
v0fbu1vm•16mo 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.
🥄feeders help me learn faster !
Where do you put the Migrations folder? In a separate project?
v0fbu1vm
v0fbu1vm•16mo ago
No description
v0fbu1vm
v0fbu1vm•16mo 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.
🥄feeders help me learn faster !
Where is the Migrations folder?
v0fbu1vm
v0fbu1vm•16mo 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
🥄feeders help me learn faster !
public repo?
v0fbu1vm
v0fbu1vm•16mo 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-1OP•16mo ago
this approach called vertical slice architecture, you can search on github
jcotton42
jcotton42•16mo ago
$vsa is what we usually link here
MODiX
MODiX•16mo 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!

Did you find this page helpful?