Export (0) Print
Expand All

Organizing an ASP.NET MVC Application by Functional Areas

[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

The MVC pattern separates the model (data) logic of an application from its presentation logic and business logic. In ASP.NET MVC, this logical separation is also implemented physically in the project structure, where controllers and views are kept in folders that use naming conventions to define relationships. This structure supports the needs of most Web applications.

However, some applications can have a large number of controllers, and each controller can be associated with several views. The default ASP.NET MVC project structure can become unwieldy for these types of applications.

To accommodate large projects, ASP.NET MVC provides a means to partition Web applications into smaller units that are referred to as areas. Areas provide a way to separate a large MVC Web application into smaller functional groupings. An area is effectively an MVC structure inside an application that could contains several other MVC structures (areas).

For example, a single large e-commerce application might be divided into areas that represent the storefront, product reviews, user account administration, and the purchasing system. Each area represents a separate function of the overall application.

You can implement an areas application using either a single Visual Studio project or multiple projects in which each project represents an area. If your team is small and you simply want to take advantage of the additional organization that areas provide, you might want to consider using the single-project approach. If your team is large and you want to divide development tasks by area, you might want to create a solution that has multiple projects.

A single-project areas application is organized like a standard ASP.NET MVC application, but it has an added Areas folder. The Areas folder contains a subfolder for each of the child areas in the application. Each child area folder has its own models, views, and controllers. For more information, see Walkthrough: Creating an ASP.NET MVC Areas Application Using a Single Project.

A multi-project areas application consists of a single Visual Studio solution with one main project and an additional project for each area. The main project has a reference to each child (area) project. Each area has its own models, views, and controllers. For more information, see Walkthrough: Creating an ASP.NET MVC Areas Application Using Multiple Projects.

Title

Description

Walkthrough: Creating an ASP.NET MVC Areas Application Using a Single Project

Shows how to create an ASP.NET MVC application that is organized into functional areas using a single Visual Studio project.

Walkthrough: Creating an ASP.NET MVC Areas Application Using Multiple Projects

Shows how to create an ASP.NET MVC application that is organized into functional areas using multiple Visual Studio projects.

Show:
© 2014 Microsoft