Reputation: 13
I am playing at solution architecture for an Intranet Web Site. I have used a single project approach instead of a multiple project approach given my limited understanding of sharing resources between them.
I want to segregate departments within the company. I see areas as the solution to this problem, but now I need to segregate within those departments. I am unsure how to approach this situation.
Solution > Project > Areas > Department
The architecture above works fine, but when I try to use the context menu to add an area inside an area, I cannot. I am sure this is by design so I'm wondering what is the approach I am meant to take?
Upvotes: 1
Views: 263
Reputation: 56909
MVC's architecture separates the physical location of code files from the virtual location of the code that is executed (the URL). You can modify the URLs using routing to change the locations that the resources are virtually located. This is all that the end user sees.
Areas are only 1 level deep. But the URLs of where Areas are located can be modified according to your requirements.
Alternatively, if the goal is to make the physical location and the virtual location match (which really only matters to the developers that are maintaining the application), there is an open source project called MvcCodeRouting that can be used as a hierarchical multi-level replacement for Areas.
Upvotes: 2
Reputation: 24280
The purpose of MVC Areas is not to reflect the structure of your organization, but to bundle related pieces of functionality. E.g. you could define areas named Employees
, Benefits
, CompanyCars
, Expenses
etc.
Also by definition, only 1 level of Areas can exist. So either you have areas, all Area Controllers are then living 1 'level' below the root of the site (and if you want, you can still also have root level Controllers). Or you don't have areas, all Controllers will then exist next to each other at root level.
Upvotes: 1