ASP.NET MVC 1.0 provides a new Model-View-Controller (MVC) framework on top of the existing ASP.NET 3.5 runtime[1].We will build a complete MVC app from ground zero and will explore the underlying MVC details. We will compare ASP.NET web application with MVC app . Aim of this presentation is to establish a solid understanding of this new application model.
1. MVC for ASP.NET Developers
Abhijit Gadkari
Enterprise Architect
http://www.technolatte.net/image.axd?picture=2009%2F3%2Frequest.jpg
Yet Other WebFramework!
2. Million $ Question?
“Who here is attending this talk
because you are concerned that
ASP.NET MVC is going to throw
out all of your existing knowledge
on Web Forms and require
you to learn new technology?”
From Chapter 2 of the Professional ASP.NET MVC
3. Please Note:
Release of ASP.NET MVC does not mean the
death of Web Forms. This just isn't true.
ASP.NET MVC is not ASP.NET Web Forms 4.0.
It's an alternative to Web Forms,
and it's a fully supported part of the
[.NET] framework.
Professional ASP.NET MVC 1.0 by
Scott Guthrie et al.
[page 171]
6. Model View Controller (MVC) is one of the most quoted (and most
misquoted) pattern around. It started as a framework developed
By Trygve Reenskaug for the Smalltalk platform in the late 1970s.
Since then it has played an influential role in most UI frameworks
and the thinking about UI design.
- from Patterns of Enterprise Application Architecture by Martin
Fowler et.al. Page 330
View Controller
Model
Splits user interface interaction into three distinct roles.
7. What is a Model View Controller (MVC) Framework?
MVC is a framework methodology that divides an application's
implementation into three component roles: models, views,
and controllers.
"Models" in a MVC based application are the components of the application
that are responsible for maintaining state. Often this state is persisted inside
a database (for example: we might have a Product class that is used to
represent order data from the Products table inside SQL).
"Views" in a MVC based application are the components responsible
for displaying the application's user interface. Typically this UI is created
off of the model data (for example: we might create an Product "Edit" view
that surfaces textboxes, dropdowns and checkboxes based on the
current state of a Product object).
"Controllers" in a MVC based application are the components responsible for
handling end user interaction, manipulating the model, and ultimately
choosing a view to render to display UI. In a MVC application
the view is only about displaying information - it is the controller that
handles and responds to user input and interaction.
8. http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx
One of the benefits of using a MVC methodology is that it helps
enforce a clean separation of concerns between the models, views
and controllers within an application.
Maintaining a clean separation of concerns makes
the testing of applications much easier, since the contract between
different application components are more clearly defined and articulated.
Slide 4 and 5 from
http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx
9. My First MVC
Application...
MVC is built on top of ASP.NET
12. Summary
MVC framework is not an alternative to the existing web form
Technology. Use Web Forms on projects where you use third party
server controls, web parts and dynamic data
Going forward MS will support MVC as well as Web Forms
MVC can be added to the existing ASP.NET web form application
ASP.NET MVC ASP.NET Web Forms
No Server Controls Based on the standard server
control model
No Postbacks and ViewState – Postbacks and ViewState is an
View will talk to the controller integral part of this framework
Controller is the glue that binds Codebehind file is a glue that
a view with the model binds a view with the model
Doesn't hide HTML & HTTP Hides HTML and HTTP
13. Thanks for attending this presentation.
Please let me know your feedback on abhigad@hotmail.com
14. We are planning on conducting
a day long [9 -5] hands-on
seminar on ASP.NET MVC in
Orange County.
Let us know if you
are interested...
ABHIGAD@HOTMAIL.COM