C
C#2y ago
Denis

❔ How to properly structure projects in a multi-app MVVM solution?

I tend to structure my MVVM projects in the following way:
.
├── src/
│ ├── Applications/
│ │ ├── Cashier.Terminal.csproj
│ │ ├── Cashier.Administrator.csproj
│ │ └── ..
│ ├── Servers/
│ │ ├── Database.csproj
│ │ ├── Email.csproj
│ │ └── ..
│ ├── Libraries/
│ │ ├── Helpers/
│ │ │ └── ..
│ │ ├── Views/
│ │ │ └── ..
│ │ ├── ViewModels/
│ │ │ └── ..
│ │ ├── Models/
│ │ │ └── ..
│ │ └── Entities/
│ │ └── ..
│ └── Plugins/
│ └── ..
└── test/
.
├── src/
│ ├── Applications/
│ │ ├── Cashier.Terminal.csproj
│ │ ├── Cashier.Administrator.csproj
│ │ └── ..
│ ├── Servers/
│ │ ├── Database.csproj
│ │ ├── Email.csproj
│ │ └── ..
│ ├── Libraries/
│ │ ├── Helpers/
│ │ │ └── ..
│ │ ├── Views/
│ │ │ └── ..
│ │ ├── ViewModels/
│ │ │ └── ..
│ │ ├── Models/
│ │ │ └── ..
│ │ └── Entities/
│ │ └── ..
│ └── Plugins/
│ └── ..
└── test/
Tree structure generated using https://tree.nathanfriend.io/?s=(%27options!(%27fancy5~fullPath!false~trailingSlash5~rootDot5)~7(%277%27src%2FFApplication06T9minal3*6Administrator3*GFS9v90Database3*Email32*GFLibrarie0Help9BB88Entitie4FPlugin0G2test%2F2%27)~v9sion!%271%27)*F--%20%200s%2F*2%5Cn3.csproj40-G5!true6Cashi9.7source!8Model4*9erB4*ViewF2-G..%01GFB987654320-*
The question is whether I'm not shooting myself in the foot with this approach and whether there is a better approach? Here are the following criteria I want my structure to comply with: - Separation of Applications, Servers, Plugins - An application is a program an end user interacts with - A server is something that, e.g., is accessible via an API and is used to access the DB, or perform specialized operations such as sending an email - Views and ViewModels will be shareable between multiple applications - they must be available as individual projects Is it possible to achieve that in a better way? What is the best way to structure tests (unit, integration, and application) for the projects, either with my structure or the one you propose?
1 Reply
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server