Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

ASP.NET MVC – Points 2 Note

Hi, Today I had some time for exploring about latest ASP.NET MVC model and concluded myself with few points with lot of questions. Here is those few points which you can make use to kick start your ASP.NET MVC learning.

images_aspnetlogo

 

 

 

About ASP.NET MVC from my understanding :There are few Presentation Patterns readily available for Web application. These patterns comes with pro’s and con’s as well. Its all depends about scenario and requirement we choose this patterns. It is broadly classified into 5, here we go..

Model-View-Controller

How do you modularize the user interface functionality of a Web application so that you can easily modify the individual parts.

Page Controller

How do you best structure the controller for moderately complex Web applications so that you can achieve reuse and flexibility while avoiding code duplication?

Front Controller

How do you best structure the controller for very complex Web applications so that you can achieve reuse and flexibility while avoiding code duplication?

Intercepting Filter

How do you implement common pre- and post-processing steps around Web page requests?

Page Cache

How do you improve the response time of dynamically generated Web pages that are requested frequently but consume a large amount of system resources to construct?

Observer

How can an object notify other objects of state changes without being dependent on their classes?

 

 

 

 

 

 

* MVC pattern separates the components of an MVC web application
* more control over the individual parts of the application and also lets you easily develop,modify and test them
* based on architectural pattern { Model, View, Controller }
* It is defined under System.Web.Mvc namespace
* now 3 types of Microsoft Web development
                       + Traditional web forms with Post back,view state pattern (currently we use)
                       + using MVC
                       + Mingling both ( MVC + ASP.NET traditional )

mvc_small

MVC got 3 components,
MODEL : acts as a DB interface (Business Logic), either as Object / Dataset.
  -> for DDL operation – Object (Model Object) retrieve,store,update state in DB.
  -> for DML operation – Dataset will act as Model object,fetch and display
VIEW  : acts as a UI for our Model Object/Dataset. Page with controls,CSS etc (UI Logic)
CONTROLLER : Controls and handles user interaction (Input logic), handles user input,events,query string values, values passed to method  etc

* loose coupling between the three main components of an MVC application also promotes parallel development. For instance, one developer can work on the view, a second developer can work on the controller logic, and a third developer can focus on the business logic in the model.
* MVC framework does not an replacement of Web Forms model.

Advantages of an MVC-Based Web Application :
======================================
* It easier to manage complex app by dividing an application into the model, the view, and the controller.
* It does not use view state or server-based forms, It uses a Front Controller pattern that processes Web application requests through a single controller
* It provides better support for test-driven development
* It works well for Web applications that are supported by large teams of developers and Web designers who need a
high degree of control over the application behavior.
* Mapping URLs to ASP.NET pages or handlers, the framework maps URLs to -> controller classes. Controller classes
handle incoming requests, such as user input and interactions, and execute appropriate application and data logic, based on user input.

NEW -URL Mapping : MVC framework uses a URL-routing engine that provides flexibility for mapping URLs- > controller classes.

OLD – POSTBACK: It does not use post back model for interactions with the server. Instead, all end-user interactions are routed to a controller class. so there is no view state/life-cycle events as like asp.net application.

Advantages of a Web Forms-Based Web Application :
==========================================
* It supports an event model that preserves state over HTTP, which benefits line-of-business Web application
development. The Web Forms-based application provides dozens of events that are supported in hundreds of server controls.
* It uses a Page Controller pattern that adds functionality to individual pages.
* It uses view state or server-based forms, which can make managing state information easier.
* In general, it is less complex for application development, because the components (the Page class, controls, and
so on) are tightly integrated and usually require less code than the MVC model.
* In an ASP.NET Web site, URLs typically map to files that are stored on disk (usually .aspx files). These .aspx
files include markup and code that is processed in order to respond to the request.

From below ref : (1) http://www.asp.net/mvc (2) http://www.microsoft.com/downloads/details.aspx?FamilyID=f4e4ee26-4bc5-41ed-80c9-261336b2a5b6&displaylang=en (3) http://blogs.msdn.com/webdevtools/archive/2009/01/29/t4-templates-a-quick-start-guide-for-asp-net-mvc-developers.aspx 

I hope this would be useful for new bie’s..

Advertisements

February 2, 2009 - Posted by | .NET General

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: