ASPNET MVC Dev One is your dedicated partner providing high quality experts on architecture development and testing roles on IT projects using Microsoft NET technologies Visit us on httpwwwdevonecom ID: 215190
Download Presentation The PPT/PDF document "Hands on" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Hands on
ASP.NET MVCSlide2
Dev
One
is your dedicated partner providing high quality experts on architecture, development, and testing roles on IT projects using Microsoft .NET technologies.Visit us on:http://www.dev-one.com
We will help your enterprise to build a state of the art solution using the latest available technologies so you can rapidly deploy your applications and services. Our proven experience, and a deep understanding of your business, will help us to you reduce your IT development costs and let your employees concentrate on your core business.We are aimed at providing consultancy experts on architecture, development, and testing roles, especially using the .NET technologies and the Microsoft ecosystem. With more than 10 years of multiple IT development experiences, we have forged a set of skills through various project & missions in several activity sectors that enables us to deliver you high quality services.
About Dev One
ASP.NET MVC – Hands on
2Slide3
Presentation
What is MVC?
MVC on the web todayASP.NET MVCTimelineComparison with ASP.NET web formsWhat web forms does wellWhere web forms doesn’t fitASP.NET MVC believes
Should you fear ASP.NET MVC?The MVC patternModelViewControllerWhat’s new in ASP.NET MVC 3DemosQ & AASP.NET MVC – Hands on3AgendaSlide4
4
ASP.NET MVC – Hands on
PresentationSlide5
The MVC pattern is 30+ years old!
It is a powerful and elegant means of separating concerns
It makes it easier to test applicationIt promotes parallel development thanks to the loose coupling between the three main componentsASP.NET MVC – Hands on
5What is MVC?Slide6
Ruby on RailsDjango and Python
Spring, Struts and Java
Zend Framework and PHPMonoRail…ASP.NET MVC – Hands on
6MVC on the web todaySlide7
Separation of application tasks (input logic, business logic, and UI logic), testability, and test-driven development (TDD) by
default
An extensible and pluggable frameworkA powerful URL-mapping component that lets you build applications that have comprehensible and searchable URLsConvention over configurationDon’t repeat yourself, keep it simple (DRY/KISS principles)
ASP.NET MVC – Hands on7ASP.NET MVCSlide8
ASP.NET MVC – Hands on
8
TimelineSlide9
9
ASP.NET MVC – Hands on
Comparison with ASP.NET web formsSlide10
Represent a Page as control tree
Give these server-side controls events like their desktop counterparts
Hide as much HTTP and HTML as is reasonableMake state management as transparent as possibleASP.NET MVC – Hands on
10What web forms does wellSlide11
ViewState
is powerful, but it has its drawbacks (weight,…)
Page life cycle can be a nightmareLimited control over HTMLClient IDs and the ctl00$ContentPlaceHolder1$UserControl1$TextBox1 syndromeIt’s nearly impossible to run a Web Form through its life cycle outside IIS
ASP.NET MVC – Hands on11Where web forms doesn’t fitSlide12
Guiding tenets:
Be extensible, maintainable, and flexible
Be testableGet out of the user’s way when necessaryServing methods, not filesSeparation of concernsScottHa said: « ASP.NET MVC is Web Forms unplugged »
ASP.NET MVC – Hands on12ASP.NET MVC believesSlide13
ASP.NET MVC is built on top of ASP.NETASP.NET MVC is not a replacement for anything
It is just an alternative
It’s a totally different approachShould you fear ASP.NET MVC?ASP.NET MVC – Hands on
13Slide14
14
ASP.NET MVC – Hands on
The MVC patternSlide15
Model
objects are the parts of the application that implement the logic for the application’s data domain
Viewcomponents that display the application’s user interfaceControllercomponents that handle user interaction, work with the model, and ultimately select a view to render
ASP.NET MVC – Hands on15The MVC patternSlide16
Business logic and validation of the application’s data domain
Totally independant from the views or the controllers
Model state can be stored in memory, database, XML files,…ASP.NET MVC – Hands on16
ModelSlide17
Application’s user interface using data from the model
No interaction with the models or the controllers
Views can be strongly typedAlmost no codeASP.NET MVC – Hands on17
ViewSlide18
Handle user interactionQuery the model
Select the right view to render
ASP.NET MVC – Hands on18
ControllerSlide19
19
ASP.NET MVC – Hands on
What’s new in ASP.NET MVC 3Slide20
Razor
View EngineSupport for multiple view engineGlobal action filters«
ViewBag » propertyNew « ActionResult » typesJavaScript and AJAX improvementsClient-side validation enabled by defaultRemote validatorJSON binding supportData annotations metadata attributesValidation interfaces
Dependency injection improvementsPartial-Page Output
CachingGranular Control over Request Validation
…ASP.NET MVC – Hands on
20
What’s new in ASP.NET MVC 3Slide21
21
ASP.NET MVC – Hands on
DemosSlide22
Using the ASP.NET MVC 3 template and playing around with Razor
First data access and display a list of authors
Manage authorsDisplay a list of booksCreate and edit a book using the ViewModel patternSource code available on:
http://vil.rs/qK3rMGASP.NET MVC – Hands on22Book storeSlide23
23
ASP.NET MVC – Hands on
Q & ASlide24
ASP.NET MVC – Hands on
24