SlideShare a Scribd company logo
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 (19)

Introducing Visual Studio Online
Introducing Visual Studio Online
Ed Blankenship
 
ReactJS or Angular
ReactJS or Angular
boyney123
 
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 Know
PixelCrayons
 
Quid
Quid
Pedro J. Molina
 
Cross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript Development
Jeremy Likness
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
Quan Truong Anh
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
Timmy Kokke
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"
Itaru Kitagawa
 
Angular overview
Angular overview
Thanvilahari
 
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)
Mandar Majmudar
 
Microsoft Silverlight
Microsoft Silverlight
thinkahead.net
 
Latest Web development technologies 2021
Latest Web development technologies 2021
SWATHYSMOHAN
 
Asp.netmvc handson
Asp.netmvc handson
Prashant Kumar
 
WebSite development using WinJS
WebSite development using WinJS
Alexandre Marreiros
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021
ForceBolt
 
dot net
dot net
sambhajimeher
 
Resume_new
Resume_new
Rajesh K P
 
Introducing Visual Studio Online
Introducing Visual Studio Online
Ed Blankenship
 
ReactJS or Angular
ReactJS or Angular
boyney123
 
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 Know
PixelCrayons
 
Cross Platform Angular 2 and TypeScript Development
Cross Platform Angular 2 and TypeScript Development
Jeremy Likness
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
Quan Truong Anh
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
Timmy Kokke
 
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?
OutSystems
 
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
SWATHYSMOHAN
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021
ForceBolt
 

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

ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
Asp.Net MVC3 - Basics
Asp.Net MVC3 - Basics
Saravanan Subburayal
 
Asp.Net Mvc
Asp.Net Mvc
micham
 
Mvc3 crash
Mvc3 crash
Melick Baranasooriya
 
Aspnet mvc
Aspnet mvc
Hiep Luong
 
ASP .net MVC
ASP .net MVC
Divya Sharma
 
ASP.NET MVC - Whats The Big Deal
ASP.NET MVC - Whats The Big Deal
Venketash (Pat) Ramadass
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVC
Sagar Kamate
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingasp
Giovanni Javier Jimenez Cadena
 
Mvc summary
Mvc summary
Muhammad Younis
 
Day7
Day7
madamewoolf
 
MVC 4
MVC 4
Vasilios Kuznos
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
Bruno Matos Tavares
 
Intro to .NET for Government Developers
Intro to .NET for Government Developers
Frank La Vigne
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0
Buu Nguyen
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
Dilip Patel
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
 
Syllabus PS03CINT05 detailing
Syllabus PS03CINT05 detailing
OPENLANE
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Pattern
maddinapudi
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
Asp.Net Mvc
Asp.Net Mvc
micham
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVC
Sagar Kamate
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 
Intro to .NET for Government Developers
Intro to .NET for Government Developers
Frank La Vigne
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0
Buu Nguyen
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
Dilip Patel
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
 
Syllabus PS03CINT05 detailing
Syllabus PS03CINT05 detailing
OPENLANE
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Pattern
maddinapudi
 
Ad

More from Volodymyr Voytyshyn (6)

.NET Career Direction
.NET Career Direction
Volodymyr Voytyshyn
 
Soft skills for Students
Soft skills for Students
Volodymyr Voytyshyn
 
SPA: Key Questions
SPA: Key Questions
Volodymyr Voytyshyn
 
Modern JavaScript Applications: Design Patterns
Modern JavaScript Applications: Design Patterns
Volodymyr Voytyshyn
 
Let trust our estimates
Let trust our estimates
Volodymyr Voytyshyn
 
Managed Extensibility Framework
Managed Extensibility Framework
Volodymyr Voytyshyn
 
Ad

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: [email protected] [email protected] Skype: voytyshin Thank You! Copyright © 2011 SoftServe, Inc.