Understanding ASP.NET MVC

28
Understanding ASP.NET MVC Shravan Kumar Thomson Reuters

description

Understanding ASP.NET MVC

Transcript of Understanding ASP.NET MVC

Page 1: Understanding ASP.NET MVC

Understanding ASP.NET MVC

Shravan Kumar

Thomson Reuters

Page 2: Understanding ASP.NET MVC

Walk Away Knowing

Introduction to ASP.NET MVC

Digging into ASP.NET MVC

What’s new in ASP.NET MVC3?

Page 3: Understanding ASP.NET MVC

What is ASP.NET?

Caching Modules

HandlersIntrinsics

Pages Controls

Globalization

Profile

Master Pages

MembershipRoles

Etc...

ASP.NET

One web applicationframework to rule them all…

Page 4: Understanding ASP.NET MVC

ASP.NET CORE Runtime

ASP.NET WebForms Presentation

Page 5: Understanding ASP.NET MVC

WebForms is great, But it does have some weaknesses

Page 6: Understanding ASP.NET MVC

No real role responsibility…

Who does what?How and when?

Master Page

Control

Control

UIPresentation LogicBusiness LogicData Access

Control

ControlPage

Control

Control

Control

Control

Page 7: Understanding ASP.NET MVC

Control abstractions can be negative…

Page 8: Understanding ASP.NET MVC

Logic UI

It isn’t easy enough to test

Page 9: Understanding ASP.NET MVC

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

Page 10: Understanding ASP.NET MVC

Presentation

ASP.NET CORE Runtime

Now ASP.NET

ASP.NET WebFor

ms

ASP.NETMVC

Page 11: Understanding ASP.NET MVC

What is MVC?

A design pattern

Separation of concerns

Acronym for Model ● View ● Controller

Page 12: Understanding ASP.NET MVC

MVCModel

ControllerView

Page 13: Understanding ASP.NET MVC

What is MVC?

Step 1Incoming request routed to Controller

Request

Controller

Page 14: Understanding ASP.NET MVC

What is MVC?

Step 2Controller processes request and creates presentation

Model

Controller

Model

Page 15: Understanding ASP.NET MVC

What is MVC?

Step 3Model is passed to View

Controller

View

Page 16: Understanding ASP.NET MVC

What is MVC?

Step 4View transforms Model into appropriate output format

Controller

View

Page 17: Understanding ASP.NET MVC

What is MVC?

Step 5Response is rendered

Response

Controller

View

Page 18: Understanding ASP.NET MVC

THE FUN STUFFShow Me Some Code!

Page 19: Understanding ASP.NET MVC

Framework Goals

Frictionless Testability Tight control over <markup/>

User/SEO friendly URLs

Leverage the benefits of ASP.NET

Conventions and Guidance

Page 20: Understanding ASP.NET MVC
Page 21: Understanding ASP.NET MVC

Separation of Concerns

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

More easily testable (TDD)

Helps with concurrent development

Page 22: Understanding ASP.NET MVC

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)

Page 23: Understanding ASP.NET MVC

Extensible

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

Plays well with others

Page 24: Understanding ASP.NET MVC

DEMO – ASP.NET MVC

Page 25: Understanding ASP.NET MVC

What’s New in ASP.NET MVC3?

Page 26: Understanding ASP.NET MVC

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

Page 27: Understanding ASP.NET MVC

It’s Question Time!

Page 28: Understanding ASP.NET MVC

Be well,and stay in touch

[email protected]://theshravan.net/blog

Twitter: techieshravan