views:

76

answers:

1

I want to structure my ASP.NET MVC 2 web application sensibly using Areas. The application consists of the two main parts Website which is the default part and Dashboard which administrates the site using a CMS. (Probably, more Areas will follow later on.)

How do I structure my project best? Should I ...

  1. create the Area Dashboard and put the stuff belonging to the Website part into the main application folder or should I
  2. create both Areas Website and Dashboard?

Additionally, where should I place my Entity Data Model and the corresponding Repository classes that have to be accessed by both Areas?

+2  A: 

I would go with option 1. Then your urls would look like this (if you use the default routing):

Website: http://mysite/ Dashboard: http://mysite/dashboard

If you change your mind later on, it's not too difficult to move your website into an area.

As for your "model", I wouldn't bother with the Models folders created by default for an MVC project. I would probably put this in its own project, give it a sensible namespace (mysite.domain or mysite.model) and reference it from the mvc app.

Peter
Agreed. I would personally have the area's name as 'admin' and then 'dashboard' would be a controller in the admin area... Kinda makes more sense to me but it's totally personal preference.
Charlino