Understanding ASP.NET MVC

Post on 14-Dec-2014

3.950 views 0 download

description

Understanding ASP.NET MVC

Transcript of Understanding ASP.NET MVC

Understanding ASP.NET MVC

Shravan Kumar

Thomson Reuters

Walk Away Knowing

Introduction to ASP.NET MVC

Digging into ASP.NET MVC

What’s new in ASP.NET MVC3?

What is ASP.NET?

Caching Modules

HandlersIntrinsics

Pages Controls

Globalization

Profile

Master Pages

MembershipRoles

Etc...

ASP.NET

One web applicationframework to rule them all…

ASP.NET CORE Runtime

ASP.NET WebForms Presentation

WebForms is great, But it does have some weaknesses

No real role responsibility…

Who does what?How and when?

Master Page

Control

Control

UIPresentation LogicBusiness LogicData Access

Control

ControlPage

Control

Control

Control

Control

Control abstractions can be negative…

Logic UI

It isn’t easy enough to test

How does ASP.NET MVC Differ?

A new Web Application Project type

Not a replacement for WebForms -Builds on top of ASP.NET

Simply an another option

Presentation

ASP.NET CORE Runtime

Now ASP.NET

ASP.NET WebFor

ms

ASP.NETMVC

What is MVC?

A design pattern

Separation of concerns

Acronym for Model ● View ● Controller

MVCModel

ControllerView

What is MVC?

Step 1Incoming request routed to Controller

Request

Controller

What is MVC?

Step 2Controller processes request and creates presentation

Model

Controller

Model

What is MVC?

Step 3Model is passed to View

Controller

View

What is MVC?

Step 4View transforms Model into appropriate output format

Controller

View

What is MVC?

Step 5Response is rendered

Response

Controller

View

THE FUN STUFFShow Me Some Code!

Framework Goals

Frictionless Testability Tight control over <markup/>

User/SEO friendly URLs

Leverage the benefits of ASP.NET

Conventions and Guidance

Separation of Concerns

Each component has one responsibilitySRP – Single Responsibility PrincipleDRY – Don’t Repeat Yourself

More easily testable (TDD)

Helps with concurrent development

Clean URLs

REST-like

/products/update

/blog/posts/2008/08/12/mvc-is-cool

Friendlier to humans

/product.aspx?categoryid=123 to become

Becomes /products/kittens/

Friendlier to web crawlers

Search engine optimization (SEO)

Extensible

Replace any component of the system Interface-based architectureVery few sealed methods / classes

Plays well with others

DEMO – ASP.NET MVC

What’s New in ASP.NET MVC3?

What’s new in ASP.NET MVC 3?

Razor View Engine

Multple View Engine Support

Validation Improvement

s

Dynamic View and

ViewModel Properties

Global Action Filters

Support for Permanent Redirects

New Project Dialog

Improvements

VBHTML Support

Tasked based helpers

Improved Dependency

Injection

Porting MVC Script

Libraries to jQuery

Granular ValidateInput

Add View Dialog

Improvements

New Project Dialog

Extensibility Improvement

s

Improved Caching Support

Remote Validator

It’s Question Time!

Be well,and stay in touch

shravan.kasagoni@gmail.comhttp://theshravan.net/blog

Twitter: techieshravan