C
C#4d ago
Cydo

✅ Clarification on VSA

Been watching a ton of videos and reading a bunch of VSA and I'm still a bit confused, does VSA eliminate the need for multiple projects in a solution? For example this video https://www.youtube.com/watch?v=C4XSAp4Fkqo everything appears to be in one project, but then I've seen examples split among multiple projects, and even everything just inside of one file per "feature".
Hubert Mijalski
YouTube
How to design & create .NET API in 2022
Exploring the Vertical Slice architecture in practice by taking advantage of .NET Minimal APIs. Organizing your code into modules that are fully self-contained can be extremely beneficial and allow you to deliver product quickly, without closing the door to microservices later down the road. Repo link: https://github.com/Mijalski/MinimalApiTut...
7 Replies
mg
mg4d ago
Technically there is no need for multiple projects in most solutions But no, VSA doesn't eliminate it as a good practice Let's say you're making a web API. It would still be advantageous to have your request/response objects in their own project, as then that project can be referenced to make a client library without needing to reference everything else in your project
Cydo
CydoOP4d ago
Okay so in my case, i have a Domain project and the only thing in there are all the different types for my database, and then i have a Application project where I'm trying to use VSA where i have a features directory where i have a specific folder per feature and inside of that folder, i have for example the command and query and dto and handler etc all related to that feature, and then finally I have an Infrastructure project that is for my repositorys/database conext and w.e configurations i may have like data base seeding Still feels like clean architecure though, im just using a features like folder instead of making services and iservices.
mg
mg4d ago
it sounds like clean architecture especially the repositories for instance, i have a project for my database entities and context, another project for 3rd party services, a project for the API contracts, and a project for the application
Jimmacle
Jimmacle4d ago
in VSA you forget domain, application, etc that's CA and is usually way more complicated than you really need
Cydo
CydoOP4d ago
Hmm I need to look at more examples then.
Jimmacle
Jimmacle4d ago
oops $close
MODiX
MODiX4d ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?