asp net mvc 2
Download
Skip this Video
Download Presentation
ASP.NET MVC 2

Loading in 2 Seconds...

play fullscreen
1 / 40

ASP.NET MVC 2 - PowerPoint PPT Presentation


  • 110 Views
  • Uploaded on

ASP.NET MVC 2. The good news. Jean-Claude Trachsel Senior Consultant, Trivadis AG j [email protected] Agenda. What is ASP.NET MVC Features of Version 2 What about the «real life»? Summary. What is ASP.NET MVC. A short introduction.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' ASP.NET MVC 2' - xander


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
asp net mvc 2
ASP.NET MVC 2

The good news

Jean-Claude Trachsel

Senior Consultant, Trivadis AG

[email protected]

agenda
Agenda
  • What is ASP.NET MVC
  • Features of Version 2
  • What about the «real life»?
  • Summary
what is asp net mvc
What is ASP.NET MVC

A short introduction

what is asp net mvc1

Framework based on Model-View-Controller Pattern

Separation of Concerns

Framework is focusing on...

Pure Web Development

Stateless, no ViewState

Full control over markup

Testability

TDD, Unit Tests

Maintainability

Extensibility and Flexibility

Modern aspects like AOP, DI, IoC

What is ASP.NET MVC
positioning asp net mvc
Positioning ASP.NET MVC
  • ASP.NET MVC
  • ASP.NET Web Forms

ASP.NET Framework

.NET Framework

slide6

Visual Studio Template

Controller and View

Unit Test

Demo
features of version 2
Features of Version 2

Areas, Validation, Typed UI Helpers, etc.

what do we get

Goals of the DevTeam for Version 2

More Productivity

More Security

More Performance

More Extensibility

MoreHappiness 

What do we get?
what we will look at
What we will look at
  • Areas
  • Validation
  • Typed UI Helpers
  • UI Helper Templates
  • Async Controllers
areas
Areas

Single Project and Multi Project Areas

areas what for

Enterprise ready with Areas

Structure your Solution with...

Single Project Area

Multi Project Area

Easy re-use of Code

Areas – what for?
areas what s needed

Single Project Area

Folder Structur

Route Class

Inherits from AreaRegistration

Defines the route to the Controller

Global.asax

Register the area routes

Areas – what’s needed?
validation
Validation

Data Annotations Attributes

asp net mvc validation

Data Validation with DataAnnotations Attributes

Introduced with .NET 3.5 SP 1

Benefits of DataAnnotations Attributes

Set in one central place, on the model

Used by different Technologies

Used in ASP.NET Dynamic Data

Used in WCF RIA Services

ASP.NET MVC Validation
use of dataannotations
Use of DataAnnotations
  • Set Attributes on the Model
  • [MetadataType(typeof(ProductMetadata))]
  • publicpartialclassProduct
  • {
  • }
  • publicclassProductMetadata
  • {
  • [Required]
  • publicstring Name { get; set; }
  • }
dataannotations

Attributes that are available

Required

Range

RegularExpression

StringLength

CustomValidation

Build your own

DataAnnotations
validation in asp net mvc

Server Site Validation

ModelBinder Class

Client Site Validation

jQuery Validation Library

Validation in ASP.NET MVC
typed ui helpers
Typed UI Helpers

...and the UI Helper Templates

typed ui helpers1

HtmlHelper Extensions

ASP.NET MVC 1

ASP.NET MVC 2

Typed UI Helpers

<%=Html.TextBox(„ProductID“,Model.ProductID)%>

<%=Html.Label(„Name“,Model.Name)%>

<%=Html.RadioButton(„Avail“,Model.Available)%>

<%=Html.DisplayFor(p => p.ProductID)%>

<%=Html.Ed itorFor(p => p.ProductID)%>

typed ui helpers2

Benefits are...

Intellisense

Compile Time Support

Type based rendering

Support for standard and complex types

Typed UI Helpers
ui helper templates

Extend the Typed UI Helper Methods

Define the Rendering via UserControls

Supports standard and complex types

Used by...

Name Convention

UI Helper Method Parameter

ViewModel Attributes

UI Helper Templates
slide24

Typed UI Helpers

UI Helper Template for DateTime

Demo
async controllers
Async Controllers

Be smart, be fast

use of async controller
Use of Async Controller

publicclassHomeController : AsyncController

{

publicvoidNAMEAsync()

{

AsyncManager.OutstandingOperations.Increment(3);

// Do all Tasks asynchronouse

}

publicActionResultNAMECompleted(object params)

{

// Do final work

returnView("NAME");

}

}

async controllers1

Async Controller is a Server Side Pipeline

For Async Clinet/Server Requests use AJAX

Do Multiple Tasks at once

Get data from different stores at the same time

Prevent Blocking of the Webserver

Worker Threads are not blocked

No Thread starvation

Async Controllers
async controllers2

Use synchronouse pipelines

Operations are simple or short-running

Simplicity is important

Use asynchronouse pipelines

Operations are network-bound or I/O-bound

Parallelism is important

Provide a mechanism to cancel long-running request

Async Controllers
what about real life
What about «real life»?

Experience from current projects

learn asp net mvc

It’s a Paradigm Shift

Can be hard forMS Win-/WebForms Developers

Easier for PHP, Java, etc. Developers

It’s a lot of Client Side Programming

New Know-How is needed

Learn ASP.NET MVC
productivity the good side

Convention over Configuration

Easy to understand

New Team Members

Maintenance

More Unit Tests

Better Quality

Less Bugfixing

Better Reusability

Productivity – the good side
productivity the down side

No reuse of existing...

Concepts

Frameworks

Controls

Loss of Functionality

(GUI)Libraries

Productivity – the down side
summary

New Web Development Paradigm perfect for...

TDD, Large Projects and Teams

Many new Features to gain...

Productivity and happiness

Use ASP.NET MVC

When ever you can 

Use ASP.NET WebForms

Need to use existing Frameworks, Libs or Controls

No time to establish needed Know-How

Summary
asp net mvc 3

Productivity

Tasked based helpers

Validation Improvements

Ajax

Multiple Partial Updates

Client Templates Support

Architecture

Dependency Injection at all levels

MEF Controller (Managed Extensibility Framework)

Performance

Improved Caching

More Control over Session

ASP.NET MVC 3
resources

Websites

http://www.asp.net/mvc

http://www.codeplex.com/aspnet

Blogs

http://www.haacked.com/

http://weblogs.asp.net/scottgu

http://www.hanselman.com

http://stephenwalther.com/blog

Resources
thank you for your attention
Thank you for your Attention!
  • For more Information please contact
  • Jean-Claude Trachsel
slide39

BesuchenSieunseren Stand

Trivadis Innovation Partnership Programm (TIPP)

Gemeinsame Innovations-Projekte

Trainings Voucher für 1 Schulungstag (Wert CHF 870.-)

SharePoint 2010

SQL Server 2008 R(2)efreshed

Business Intelligence mit Microsoft in 2010

Talent Scout

Herausfordernde, attraktive Jobs warten

MeldenSiesich!

ad