SlideShare a Scribd company logo
1 of 43
ASP.NET MVC
as the next step
in web development

                     Volodymyr Voytyshyn
                             08/27/2011
Goal

       What is ASP.NET MVC?
Contents

 About MVC Pattern
 ASP.NET Platform
 Sample Application
 ASP.NET MVC Project Concepts
 ASP.NET MVC Key Features
 MVC vs WebForms
 Conclusion
ABOUT MVC PATTERN
History of MVC Pattern

 Concept of MVC is described in 1979 by Trygve
  Reenskaug (Norway)

 One of the first version of MVC is implemented in
  Smalltallk-80 class library
Main Idea of MVC

    Separate view and data source


                   View




       Model              Controller
Classic MVC (Active Model)

                  View


                    Notify for
                    Changes
       Get data


                                        Controller



                  Model


                                 Mediator
             Data Source
Classic MVC (Passive Model)

           View
       Get data



                                   Controller


        Model



                        Mediator
     Data Source
MVP

      View




              Presenter



      Model   Mediator
MVP: Key Differences with Classic MVC

 Presenter knows all about View
 Presenter communicates with data source directly
 Events in Model and View removed
 Presenter implements main presentation logic
 Presenter is mediator between Model and View
ASP.NET PLATFORM
ASP.NET Web Forms Key Versions

                                           ASP.NET 4.0
                                              2010
                             ASP.NET 3.5
                                2007
               ASP.NET 2.0
                  2005
 ASP.NET 1.0
    2002




    ASP
    1998
ASP.NET MVC Key Versions


                                 ASP.NET MVC 3
                                      2011
                 ASP.NET MVC 2
                      2010
 ASP.NET MVC 1
      2009




   ASP.NET
ASP.NET Components


         Web Forms View Engine                Razor View Engine

        ASP.NET                              ASP.NET
       Web Forms                              MVC

                     ASP.NET Core
    Pages          Caching        Handlers             Roles
   Controls        Modules        Security          Profile

 Master Pages    Globalization   Membership            Etc.
SAMPLE APPLICATION
Concept

 Project name: “Easy Reporting”

 Idea: time tracking system for developers
Key Use Cases

uc Use Case




               Report w orking time   Confirm dev eloper's
                                         w orking time

  Dev eloper                                                     Manager




                                        Manage proj ects     Manage tasks
Components
   cmp Component


                                             Presentation Layer


                 ASP.NET                         «Web Application»                 «Class Library»
                Membership           «use»                               «use»
                                                      WebUI                        Castle Windsor



                                                                                 ASP.NET MVC 3
                                                        «use»
                                     «use»


                                             Data Access Layer


                                                                                 Entity Framework 4
                   «Class Library»                «Class Library»
                        DAL          «use»           Entities




             Repository Pattern
                                                          Linq to Entities



                                                Data Layer

            MS SQL Server 2008
                                                    «database»
                                                        ER
BASIC CONCEPTS OF MVC PROJECT
Typical MVC Project Structure
Simple Controller and Action
          ProjectController.cs




                                 Controller


 Action
Simple View
         Index.cshtml
Simple Client Page
MVC Implementation

                     Mediator

                     Controller
 Client




            View       Action




                      Model
ASP.NET MVC KEY FEATURES
Action Results

  ActionResult – base class of result of an action



      View                     File
      Redirect                 HTTP
      JavaScript               Content
      Json                     Empty
Action Filters
                        Filter types:         Filter scope:
                          – Authorization        – Action
     Action Filter        – Action               – Controller
                          – Result               – Application
                          – Exception


      Action
                                    Standard filters:
                                      – Authorize
                                      – HttpGet
                                      – HttpPost
     Action Filter
                                      – OutputCache
                                      – HandleError
Action Filters: Example
  ProjectController.cs
View Engines Concept



                                 Razor


  ASP.NET MVC          *.aspx / *.ascx / *.master


                                  Etc.
Passing data into View


                  Model


                 ViewData

   Action                   View
                 ViewBag


                 TempData
HTML Helpers


 HTML Helper – “server control” in ASP.NET MVC



 Classic HTML Helpers      Declarative HTML Helpers
Partial Views

   Partial view – “user control” in ASP.NET MVC

  _Layout.cshtml                 Header.cshtml




                                 Footer.cshtml
Layout pages and sections



  Layout page – “master page” in ASP.NET MVC




  Section – “ContentPlaceHolder” in ASP.NET MVC
Routing


                                            Controller
              URL
                       Routing
 Client                Engine                 Action

                                              Params




          Default route - /controller/action/id
Dependency Injection


  IServiceLocator    Setup         MvcServiceLocator


     Implement                          Controller Factory


                                           Controller
   Service Locator
                     Instantiate
  Implementation                          Action Filter


                                              View
Unit Testing

        Using
                                           Testable
 Inversion of Control
                                           Application
       principle



                    Can be tested:
                        –   Controllers
                        –   Routes
                        –   Html helpers
                        –   UI Models
                        –   View logic
                        –   Etc.
MVC Control Libraries

Client Side Controls    Server Side Controls

   JQuery IU              Telerik
   DOJO                   DevExpress
   Etc.                   Etc.
MVC VS WEBFORMS
When we do not need MVC?

 I need MVC, because
 … it is better than Web Forms
 … it implements MVC architecture
 … I want to escape from view state
 … I do not want automatically generated id in
 HTML
 … I want to get full control over HTML
 … I want more friendly URLs
MVC Benefits

 Automated testing
 Powerful AJAX client side
 Flexibility, extensibility, clarity
 Easy of learning and easy of using
 Clearly separated client side and server side
MVC Disadvantages

 Speed of development
  (particularly in early stages)

 … but you can win when you
  make changes in finished product
Conclusion
Contacts

                                   Volodymyr Voytyshyn
                                   5 Knyahyni Olhy Str., Rivne 33000, Ukraine


                                   Tel:       +38(066) 41 83 509

                                   E-mail:    vvoit@softserveinc.com
                                              voytyshyn@gmail.com

                                   Skype:     voytyshin




                                   Thank You!


Copyright © 2011 SoftServe, Inc.

More Related Content

What's hot

Introducing Visual Studio Online
Introducing Visual Studio OnlineIntroducing Visual Studio Online
Introducing Visual Studio OnlineEd Blankenship
 
ReactJS or Angular
ReactJS or AngularReactJS or Angular
ReactJS or Angularboyney123
 
Knockout, TypeScript, and Nested Grids, Oh My!
Knockout, TypeScript, and Nested Grids, Oh My!Knockout, TypeScript, and Nested Grids, Oh My!
Knockout, TypeScript, and Nested Grids, Oh My!Sam Larko
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowPixel Crayons
 
Cross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript DevelopmentCross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript DevelopmentJeremy Likness
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationQuan Truong Anh
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsTimmy Kokke
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"Itaru Kitagawa
 
Templates: Where Should Its Elements Be? In the Template or on Another Module?
Templates: Where Should Its Elements Be? In the Template or on Another Module?Templates: Where Should Its Elements Be? In the Template or on Another Module?
Templates: Where Should Its Elements Be? In the Template or on Another Module?OutSystems
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)Mandar Majmudar
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021SWATHYSMOHAN
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021ForceBolt
 

What's hot (19)

Introducing Visual Studio Online
Introducing Visual Studio OnlineIntroducing Visual Studio Online
Introducing Visual Studio Online
 
ReactJS or Angular
ReactJS or AngularReactJS or Angular
ReactJS or Angular
 
Knockout, TypeScript, and Nested Grids, Oh My!
Knockout, TypeScript, and Nested Grids, Oh My!Knockout, TypeScript, and Nested Grids, Oh My!
Knockout, TypeScript, and Nested Grids, Oh My!
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To Know
 
Quid
QuidQuid
Quid
 
Cross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript DevelopmentCross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript Development
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"
 
Angular overview
Angular overviewAngular overview
Angular overview
 
Templates: Where Should Its Elements Be? In the Template or on Another Module?
Templates: Where Should Its Elements Be? In the Template or on Another Module?Templates: Where Should Its Elements Be? In the Template or on Another Module?
Templates: Where Should Its Elements Be? In the Template or on Another Module?
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlight
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021
 
Asp.netmvc handson
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
 
WebSite development using WinJS
WebSite development using WinJSWebSite development using WinJS
WebSite development using WinJS
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021
 
dot net
dot netdot net
dot net
 
Resume_new
Resume_newResume_new
Resume_new
 

Similar to ASP.NET MVC as the next step in web development

SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttLanvige Jiang
 
Spring MVC introduction HVA
Spring MVC introduction HVASpring MVC introduction HVA
Spring MVC introduction HVAPeter Maas
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetIndiandotnet
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backboneRTigger
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
What is ASP.NET MVC
What is ASP.NET MVCWhat is ASP.NET MVC
What is ASP.NET MVCBrad Oyler
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overviewSergey Seletsky
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 

Similar to ASP.NET MVC as the next step in web development (20)

SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Spring MVC introduction HVA
Spring MVC introduction HVASpring MVC introduction HVA
Spring MVC introduction HVA
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Asp.Net MVC3 - Basics
Asp.Net MVC3 - BasicsAsp.Net MVC3 - Basics
Asp.Net MVC3 - Basics
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
Mvc3 crash
Mvc3 crashMvc3 crash
Mvc3 crash
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
MVC
MVCMVC
MVC
 
Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
What is ASP.NET MVC
What is ASP.NET MVCWhat is ASP.NET MVC
What is ASP.NET MVC
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 

More from Volodymyr Voytyshyn

More from Volodymyr Voytyshyn (6)

.NET Career Direction
.NET Career Direction.NET Career Direction
.NET Career Direction
 
Soft skills for Students
Soft skills for StudentsSoft skills for Students
Soft skills for Students
 
SPA: Key Questions
SPA: Key QuestionsSPA: Key Questions
SPA: Key Questions
 
Modern JavaScript Applications: Design Patterns
Modern JavaScript Applications: Design PatternsModern JavaScript Applications: Design Patterns
Modern JavaScript Applications: Design Patterns
 
Let trust our estimates
Let trust our estimatesLet trust our estimates
Let trust our estimates
 
Managed Extensibility Framework
Managed Extensibility FrameworkManaged Extensibility Framework
Managed Extensibility Framework
 

ASP.NET MVC as the next step in web development

  • 1. ASP.NET MVC as the next step in web development Volodymyr Voytyshyn 08/27/2011
  • 2. Goal What is ASP.NET MVC?
  • 3. Contents  About MVC Pattern  ASP.NET Platform  Sample Application  ASP.NET MVC Project Concepts  ASP.NET MVC Key Features  MVC vs WebForms  Conclusion
  • 5. History of MVC Pattern  Concept of MVC is described in 1979 by Trygve Reenskaug (Norway)  One of the first version of MVC is implemented in Smalltallk-80 class library
  • 6. Main Idea of MVC Separate view and data source View Model Controller
  • 7. Classic MVC (Active Model) View Notify for Changes Get data Controller Model Mediator Data Source
  • 8. Classic MVC (Passive Model) View Get data Controller Model Mediator Data Source
  • 9. MVP View Presenter Model Mediator
  • 10. MVP: Key Differences with Classic MVC  Presenter knows all about View  Presenter communicates with data source directly  Events in Model and View removed  Presenter implements main presentation logic  Presenter is mediator between Model and View
  • 12. ASP.NET Web Forms Key Versions ASP.NET 4.0 2010 ASP.NET 3.5 2007 ASP.NET 2.0 2005 ASP.NET 1.0 2002 ASP 1998
  • 13. ASP.NET MVC Key Versions ASP.NET MVC 3 2011 ASP.NET MVC 2 2010 ASP.NET MVC 1 2009 ASP.NET
  • 14. ASP.NET Components Web Forms View Engine Razor View Engine ASP.NET ASP.NET Web Forms MVC ASP.NET Core Pages Caching Handlers Roles Controls Modules Security Profile Master Pages Globalization Membership Etc.
  • 16. Concept  Project name: “Easy Reporting”  Idea: time tracking system for developers
  • 17. Key Use Cases uc Use Case Report w orking time Confirm dev eloper's w orking time Dev eloper Manager Manage proj ects Manage tasks
  • 18. Components cmp Component Presentation Layer ASP.NET «Web Application» «Class Library» Membership «use» «use» WebUI Castle Windsor ASP.NET MVC 3 «use» «use» Data Access Layer Entity Framework 4 «Class Library» «Class Library» DAL «use» Entities Repository Pattern Linq to Entities Data Layer MS SQL Server 2008 «database» ER
  • 19. BASIC CONCEPTS OF MVC PROJECT
  • 20. Typical MVC Project Structure
  • 21. Simple Controller and Action ProjectController.cs Controller Action
  • 22. Simple View Index.cshtml
  • 24. MVC Implementation Mediator Controller Client View Action Model
  • 25. ASP.NET MVC KEY FEATURES
  • 26. Action Results ActionResult – base class of result of an action  View  File  Redirect  HTTP  JavaScript  Content  Json  Empty
  • 27. Action Filters  Filter types:  Filter scope: – Authorization – Action Action Filter – Action – Controller – Result – Application – Exception Action  Standard filters: – Authorize – HttpGet – HttpPost Action Filter – OutputCache – HandleError
  • 28. Action Filters: Example ProjectController.cs
  • 29. View Engines Concept Razor ASP.NET MVC *.aspx / *.ascx / *.master Etc.
  • 30. Passing data into View Model ViewData Action View ViewBag TempData
  • 31. HTML Helpers HTML Helper – “server control” in ASP.NET MVC Classic HTML Helpers Declarative HTML Helpers
  • 32. Partial Views Partial view – “user control” in ASP.NET MVC _Layout.cshtml Header.cshtml Footer.cshtml
  • 33. Layout pages and sections Layout page – “master page” in ASP.NET MVC Section – “ContentPlaceHolder” in ASP.NET MVC
  • 34. Routing Controller URL Routing Client Engine Action Params Default route - /controller/action/id
  • 35. Dependency Injection IServiceLocator Setup MvcServiceLocator Implement Controller Factory Controller Service Locator Instantiate Implementation Action Filter View
  • 36. Unit Testing Using Testable Inversion of Control Application principle  Can be tested: – Controllers – Routes – Html helpers – UI Models – View logic – Etc.
  • 37. MVC Control Libraries Client Side Controls Server Side Controls  JQuery IU  Telerik  DOJO  DevExpress  Etc.  Etc.
  • 39. When we do not need MVC?  I need MVC, because … it is better than Web Forms … it implements MVC architecture … I want to escape from view state … I do not want automatically generated id in HTML … I want to get full control over HTML … I want more friendly URLs
  • 40. MVC Benefits  Automated testing  Powerful AJAX client side  Flexibility, extensibility, clarity  Easy of learning and easy of using  Clearly separated client side and server side
  • 41. MVC Disadvantages  Speed of development (particularly in early stages)  … but you can win when you make changes in finished product
  • 43. Contacts Volodymyr Voytyshyn 5 Knyahyni Olhy Str., Rivne 33000, Ukraine Tel: +38(066) 41 83 509 E-mail: vvoit@softserveinc.com voytyshyn@gmail.com Skype: voytyshin Thank You! Copyright © 2011 SoftServe, Inc.