Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The support of areas in a large application is absolutely vital in my opinion. It seems quite bizarre to me that Microsoft intends on releasing ASP.NET MVC 1.0 without built in support for areas.</p> <p>Fortunately, what the MVC lacks in capability it makes up for in extensibility. For example, in S#arp Architecture, as Asaf briefly mentioned, I took guidance from Phil Haack (<a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" rel="nofollow noreferrer">http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx</a>) and Steve Sanderson (<a href="http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/" rel="nofollow noreferrer">http://blog.codeville.net/2008/11/05/app-areas-in-aspnet-mvc-take-2/</a>) but modified the merged result to support areas directly under the view folder. (I didn't like that there was a separate "Areas" folder to hold your view areas.) In other words, if you create an "Animals" area with a corresponding controller Animals.AardvarksController, your Views folder would reflect Views/Animals/Aardvarks.</p> <p>If you're not interested in using all of S#arp Architecture, I would encourage you to at least check out how areas were implemented in this framework for use in your own application. The relevant code includes:</p> <ul> <li>The reusable area support classes: <a href="http://sharp-architecture.googlecode.com/svn/trunk/src/SharpArch/SharpArch.Web/Areas/" rel="nofollow noreferrer">http://sharp-architecture.googlecode.com/svn/trunk/src/SharpArch/SharpArch.Web/Areas/</a></li> <li>The replacement of the view engine: <a href="http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web/Global.asax.cs" rel="nofollow noreferrer">http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web/Global.asax.cs</a></li> <li>The declaration of the "area" (this example has an namespace/area called "Organization"): <a href="http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web.Controllers/RouteRegistrar.cs" rel="nofollow noreferrer">http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web.Controllers/RouteRegistrar.cs</a></li> <li>The views under the area: <a href="http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web/Views/Organization/Employees/" rel="nofollow noreferrer">http://sharp-architecture.googlecode.com/svn/trunk/src/NorthwindSample/app/Northwind.Web/Views/Organization/Employees/</a></li> </ul> <p>Incidentally, S#arp Architecture includes a CRUD scaffolding generator which takes into account nested namespaces automatically. As Asaf mentioned, you can find out more about it at <a href="http://code.google.com/p/sharp-architecture/" rel="nofollow noreferrer">http://code.google.com/p/sharp-architecture/</a></p> <p>Billy McCafferty</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload