Some types of
Web applications will benefit from the MVC framework. Others will continue to
use the traditional ASP.NET application pattern that is based on Web Forms and
postbacks. Other types of Web applications will combine the two approaches;
neither approach excludes the other.
MVC
pattern separates objects into following three important sections:
Ø
Model: This section is
specially for maintaining data. It is actually where business logic, querying
database, database connections etc. implemented.
Ø
View: Displaying all or
some portion of data or probably different view of data. View is responsible for
look and feel, sorting, formatting etc.
Ø
Controllers: They are event
handling sections which affect either the model or the view. In an MVC
application, the view only displays information; the controller handles and
responds to user input and interaction. For example, the controller handles
query-string values, and passes these values to the model, which in turn queries
the database by using the values.
The MVC pattern helps you create applications
that separate the different aspects of the application (input logic, business
logic, and UI logic), while providing a loose coupling between these elements.
The pattern specifies where each kind of logic should be located in the
application. The UI logic belongs in the view. Input logic belongs in the
controller. Business logic belongs in the model. This separation helps you
manage complexity when you build an application, because it enables you to focus
on one aspect of the implementation at a time. For example, you can focus on the
view without depending on the business logic.
Features of the ASP.NET MVC Framework
The ASP.NET MVC framework provides the following
features:
Ø
Separation of application tasks.
Ø
This is an extensible framework, easily to be customized.
Ø
Rigid support with all Asp.Net pages
Next section, we will see some of the prerequisites
required to start ASP.Net MVC application.
An introductory example
Before we start learning how to create an MVC
application, must need to know what the basic requirements to run the same
are:
|