The structure of several MVC projects

Do I need help developing an MVC framework for use in a team environment? Here is a brief explanation of what we are doing:

  • We have different departments that we will move to the Internet (MVC). For example, we have a Census Department, a Pipeline and Complex Department, etc.

Options:

  • I can configure the usual MVC solution in Visual Studio for each module. So I could have a VS solution for the census, one for Pipeline, etc. This is normal, but I want to have a general view (s) that can be used in projects (similar to the main page). How will this work in this scenario?
  • I can configure one MVC application with areas for each of the departments. Not a bad option. It solves the problem of my overall views. However, by the time we finish, by the end of this time I will be able to get 12-15 different areas. These are many subfolders and code in one huge solution. Not to mention that I could separate my model and repository from my own projects. Can this be handled with areas?
  • If it is better, I will be grateful for the help.

We have 8 to 10 developers who will work on this application, moving forward, so I just want to have a better structure.

+4
source share
2 answers

I think that there is no β€œright” answer, basically it comes down to the fact that, in your opinion, it will be easiest to build and maintain over time. So this is what I will do.

Combine the modules into more manageable units and place them in different website designs where the modules will be areas. If sharing a presentation is the most important here, then these will be the criteria by which you would group the modules into a website with different areas. Also, if they share some views, it is likely that they are also logically more or less similar, so you end up grouping them by their logical value. Then you could use them as different projects in a solution or different solutions.

There is also a way to use views from different projects . I personally have never done this, and the link is what gave Google a quick search, so be sure to look at it in detail. This can make your views re-accessible to all websites.

On models and repositories, I would get them in a completely separate project, which will then link to all websites. More recently, I try to build my models and repositories without any β€œclients”, so I usually put them in a completely separate project, and I try to create them so that they can be easily used on a website, on the Internet, a service or a desktop application .

I hope this helps, but as I said, this is by no means the correct answer (and it may be completely wrong, so if someone has a better idea, please share). By the way, if you have 8-10 developers who will work on it, be sure to ask them. A bunch of different opinions from smart people, as a rule, are combined with useful ideas.

+1
source

You can really do this in several ways.

One option is to use Portable Areas , where each area is its own assembly. This can solve your problems with the size of the project.

0
source

Source: https://habr.com/ru/post/1439472/


All Articles