introduction to asp.net mvc 2

12
Shiju Varghese Shiju Varghese http:// weblogs.asp.net/shijuvarghese Introducing ASP.NET Introducing ASP.NET MVC 2 MVC 2

Upload: shiju-varghese

Post on 15-May-2015

1.371 views

Category:

Documents


0 download

DESCRIPTION

Introduction to ASP.NET MVC 2

TRANSCRIPT

Page 1: Introduction to ASP.NET MVC 2

Shiju VargheseShiju Varghese

http://weblogs.asp.net/shijuvarghese

Introducing ASP.NET MVC 2Introducing ASP.NET MVC 2

Page 2: Introduction to ASP.NET MVC 2

Who am I?Who am I?

Shiju VargheseShiju VargheseFocus on ASP.NET MVC & DDDFocus on ASP.NET MVC & DDDASP.NET MVPASP.NET MVPBlog: http://weblogs.asp.net/shijuvargheseBlog: http://weblogs.asp.net/shijuvargheseTwitter: http://twitter.com/shijucvTwitter: http://twitter.com/shijucv

Page 3: Introduction to ASP.NET MVC 2

Session ObjectivesSession Objectives

Introduction to ASP.NET MVCIntroduction to ASP.NET MVC Demonstrate App building with ASP.NET Demonstrate App building with ASP.NET

MVC 2MVC 2

Page 4: Introduction to ASP.NET MVC 2

What is ASP.NET MVCWhat is ASP.NET MVC An alternative framework to ASP.NET Web An alternative framework to ASP.NET Web

FormsForms More control over your HTMLMore control over your HTML A more easily testable frameworkA more easily testable framework Simply an optionSimply an option

Will not a replacement for Web FormWill not a replacement for Web Form Build on top of ASP.NETBuild on top of ASP.NET

MVC ArchitectureMVC Architecture

Page 5: Introduction to ASP.NET MVC 2

DemoDemo

Page 6: Introduction to ASP.NET MVC 2

Goals of ASP.NET MVC Goals of ASP.NET MVC FrameworkFramework

Enable clean separation of concernsEnable clean separation of concerns Each component has one responsibilityEach component has one responsibility

Single Responsibility Principle (SRP)Single Responsibility Principle (SRP) Highly testable and maintainable applicationHighly testable and maintainable application

Testable by default (built with TDD in mind)Testable by default (built with TDD in mind) Red/Green/Refactor TDD Red/Green/Refactor TDD

Enable full control over the rendered HTMLEnable full control over the rendered HTML Enable clean URLs and HTMLEnable clean URLs and HTML

SEO and REST friendly URL structuresSEO and REST friendly URL structures

Page 7: Introduction to ASP.NET MVC 2

Goals of ASP.NET MVC 2

Enterprise readyBetter productivityBetter Maintainability

Page 8: Introduction to ASP.NET MVC 2

What’s New in ASP.NET MVC 2.0?

Strongly Typed HTML HelpersTemplated ViewsData AnnotationsAreas

Page 9: Introduction to ASP.NET MVC 2

ASP.NET MVC Best practices ASP.NET MVC Best practices Use a service layer to put application logic.Use a service layer to put application logic. Use ViewModel objects to pass data for Use ViewModel objects to pass data for

the Views.the Views. Use AutoMapper to map between Use AutoMapper to map between

ViewModel objects and Domain model ViewModel objects and Domain model objects.objects.

Use an Inversion of Control or MEF for Use an Inversion of Control or MEF for building loosely coupled software.building loosely coupled software.

Use your own HTML helpers to keep logic Use your own HTML helpers to keep logic out of your views.out of your views.

Page 10: Introduction to ASP.NET MVC 2

Source Code

http://RavenMVC.codeplex.com- ASP.NET MVC 2, RavenDB & Unity 2

- For MongoDB version, http://MongoMVC.codeplex.com

Page 11: Introduction to ASP.NET MVC 2

Questions?Questions?

Page 12: Introduction to ASP.NET MVC 2

ThanksThanks

Shiju VargheseShiju Varghese

Blog : http://weblogs.asp.net/shijuvargheseBlog : http://weblogs.asp.net/shijuvarghese

Twitter : http://twitter.com/shijucvTwitter : http://twitter.com/shijucv