Thanks for your reply. Using the Area approach seems similar to using directories to separate the sections of the code, instead of using Projects. The only thing that I see is that this method was recommended using MVC 2. Isn't that outdated?
When do I want to use projects instead of folders?
Member
97 Points
418 Posts
Best Practice to Create a Web Application
Jul 28, 2020 03:13 PM|lesponce|LINK
In order to design a web application for an organization, what would be the best way to create the structure for each section?
By folders or by project? Why?
If the project would be something like the following
ContentFolder
- bootstrap.css
- Site.css
Inventory <-- Folder or Project?
- Controller
- Model
- View
Products <-- Folder or Project?
- Controller
- Model
- View
DatabaseProject
Shared
- View
Etc.
All-Star
53711 Points
24036 Posts
Re: Best Practice to Create a Web Application
Jul 28, 2020 03:34 PM|mgebhard|LINK
Typically, the MVC controllers are in one MVC application and data access is in a separate project. I think you are looking for "Area" in MVC.
ASP.NET Core
https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/areas?view=aspnetcore-3.1
.NET MVC
https://docs.microsoft.com/en-us/aspnet/mvc/videos/mvc-2/how-do-i/aspnet-mvc-2-areas
Member
97 Points
418 Posts
Re: Best Practice to Create a Web Application
Jul 28, 2020 05:14 PM|lesponce|LINK
Thanks for your reply. Using the Area approach seems similar to using directories to separate the sections of the code, instead of using Projects. The only thing that I see is that this method was recommended using MVC 2. Isn't that outdated?
When do I want to use projects instead of folders?
All-Star
53711 Points
24036 Posts
Re: Best Practice to Create a Web Application
Jul 28, 2020 06:45 PM|mgebhard|LINK
Areas have been around a long time and has not changed much. It's really just a routing scheme.
Generally, project are containers for web sites, class libraries, services, business logic layer, data access layer, etc.
Member
97 Points
418 Posts
Re: Best Practice to Create a Web Application
Jul 28, 2020 08:27 PM|lesponce|LINK
Thanks for your assistance!
Member
30 Points
32 Posts
Re: Best Practice to Create a Web Application
Jul 29, 2020 09:09 AM|vsetia|LINK
You can look for Microservices Architecture it has lot of Advantages in Long Run.