26
ASP.NET MVC for Beginners Shravan Kumar Thomson Reuters

ASP.NET MVC for Begineers

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: ASP.NET MVC for Begineers

ASP.NET MVCfor Beginners

Shravan Kumar

Thomson Reuters

Page 2: ASP.NET MVC for Begineers

Walk Away Knowing

Introduction to ASP.NET MVC

Problems with ASP.NET

Page 3: ASP.NET MVC for Begineers

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: ASP.NET MVC for Begineers

ASP.NET CORE Runtime

ASP.NET WebForms Presentation

Page 5: ASP.NET MVC for Begineers

Are you happy with

ASP.NET?

Page 6: ASP.NET MVC for Begineers

WebForms is great, But it does have some weaknesses

Page 7: ASP.NET MVC for Begineers

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 8: ASP.NET MVC for Begineers

Control abstractions can be negative…

Page 9: ASP.NET MVC for Begineers

Logic UI

It isn’t easy enough to test

Page 10: ASP.NET MVC for Begineers

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 11: ASP.NET MVC for Begineers

Presentation

ASP.NET CORE Runtime

Now ASP.NET

ASP.NET WebFor

ms

ASP.NETMVC

Page 12: ASP.NET MVC for Begineers

What is MVC?

A design pattern

Separation of concerns

Acronym for Model ● View ● Controller

Page 13: ASP.NET MVC for Begineers
Page 14: ASP.NET MVC for Begineers

Separation of Concerns

SRP – Single Responsibility PrincipleDRY – Don’t Repeat Yourself

More easily testable (TDD)

Helps with concurrent development

Page 15: ASP.NET MVC for Begineers

MVC

Model

ControllerView

Page 16: ASP.NET MVC for Begineers

Framework Goals

Frictionless Testability Tight control over <markup/>

User/SEO friendly URLs

Leverage the benefits of ASP.NET

Conventions and Guidance

Page 17: ASP.NET MVC for Begineers

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 18: ASP.NET MVC for Begineers

Extensible

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

Plays well with others

Page 19: ASP.NET MVC for Begineers

What is MVC?

Step 1Incoming request routed to Controller

Request

Controller

Page 20: ASP.NET MVC for Begineers

What is MVC?

Step 2Controller processes request and creates presentation

Model

Controller

Model

Page 21: ASP.NET MVC for Begineers

What is MVC?

Step 3Model is passed to View

Controller

View

Page 22: ASP.NET MVC for Begineers

What is MVC?

Step 4View transforms Model into appropriate output format

Controller

View

Page 23: ASP.NET MVC for Begineers

What is MVC?

Step 5Response is rendered

Response

Controller

View

Page 24: ASP.NET MVC for Begineers

DEMO – ASP.NET MVC

Page 25: ASP.NET MVC for Begineers

It’s Question Time!

Page 26: ASP.NET MVC for Begineers

Be well,and stay in touch

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

Twitter: techieshravan