Professional Documents
Culture Documents
com
ASP.NET MVC
Fabian Vilers
Twitter: @fvilers
Hands on
AGENDA
Presentation
PRESENTATION
WHAT IS MVC?
The MVC pattern is 30+ years old! It is a powerful and elegant means of separating concerns It makes it easier to test application It promotes parallel development thanks to the loose coupling between the three main components
ASP.NET MVC
Separation of application tasks (input logic, business logic, and UI logic), testability, and test -driven development (TDD) by default An extensible and pluggable framework A powerful URL-mapping component that lets you build applications that have comprehensible and searchable URLs Convention over configuration Dont repeat yourself, keep it simple (DRY/KISS principles)
TIMELINE
ScottGu sketched out the core of ASP.NET MVC (~100 lines of code)
September 2007
Presenstation of Scalene at the Austin ALT.NET conference
March 2009
ASP.NET MVC 1.0
March 2010
ASP.NET MVC 2.0 Shipped with Visual Studio 2010
February 2007
December 2007
April 2009
January 2011
10
11
Ser ving methods, not files Separation of concerns ScottHa said: ASP.NET MVC is Web Forms unplugged
12
13
14
Model
objects are the parts of the application that implement the logic for the applications data domain
View
components that display the applications user interface
Controller
components that handle user interaction, work with the model, and ultimately select a view to render
ASP.NET MVC Hands on
15
MODEL
Business logic and validation of the applications data domain Totally independant from the views or the controllers Model state can be stored in memor y, database, XML files,
16
VIEW
Applications user interface using data from the model No interaction with the models or the controllers Views can be strongly typed Almost no code
17
CONTROLLER
Handle user interaction Quer y the model Select the right view to render
18
19
20
DEMOS
21
BOOK STORE
Using the ASP.NET MVC 3 template and playing around with Razor First data access and display a list of authors Manage authors Display a list of books Create and edit a book using the ViewModel pattern
22
Q&A
23
24