ASP.NET MVCas the next stepin 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...
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...
Main Idea of MVC    Separate view and data source                   View       Model              Controller
Classic MVC (Active Model)                  View                    Notify for                    Changes       Get data  ...
Classic MVC (Passive Model)           View       Get data                                   Controller        Model       ...
MVP      View              Presenter      Model   Mediator
MVP: Key Differences with Classic MVC Presenter knows all about View Presenter communicates with data source directly E...
ASP.NET PLATFORM
ASP.NET Web Forms Key Versions                                           ASP.NET 4.0                                      ...
ASP.NET MVC Key Versions                                 ASP.NET MVC 3                                      2011          ...
ASP.NET Components         Web Forms View Engine                Razor View Engine        ASP.NET                          ...
SAMPLE APPLICATION
Concept Project name: “Easy Reporting” Idea: time tracking system for developers
Key Use Casesuc Use Case               Report w orking time   Confirm dev elopers                                         ...
Components   cmp Component                                             Presentation Layer                 ASP.NET         ...
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        ...
ASP.NET MVC KEY FEATURES
Action Results  ActionResult – base class of result of an action      View                     File      Redirect      ...
Action Filters                        Filter types:         Filter scope:                          – Authorization      ...
Action Filters: Example  ProjectController.cs
View Engines Concept                                 Razor  ASP.NET MVC          *.aspx / *.ascx / *.master               ...
Passing data into View                  Model                 ViewData   Action                   View                 Vie...
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                ...
Layout pages and sections  Layout page – “master page” in ASP.NET MVC  Section – “ContentPlaceHolder” in ASP.NET MVC
Routing                                            Controller              URL                       Routing Client       ...
Dependency Injection  IServiceLocator    Setup         MvcServiceLocator     Implement                          Controller...
Unit Testing        Using                                           Testable Inversion of Control                         ...
MVC Control LibrariesClient Side Controls    Server Side Controls   JQuery IU              Telerik   DOJO              ...
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 e...
MVC Benefits Automated testing Powerful AJAX client side Flexibility, extensibility, clarity Easy of learning and easy...
MVC Disadvantages Speed of development  (particularly in early stages) … but you can win when you  make changes in finis...
Conclusion
Contacts                                   Volodymyr Voytyshyn                                   5 Knyahyni Olhy Str., Riv...
Upcoming SlideShare
Loading in …5
×

ASP.NET MVC as the next step in web development

2,685 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,685
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
42
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

ASP.NET MVC as the next step in web development

  1. 1. ASP.NET MVCas the next stepin web development Volodymyr Voytyshyn 08/27/2011
  2. 2. Goal What is ASP.NET MVC?
  3. 3. Contents About MVC Pattern ASP.NET Platform Sample Application ASP.NET MVC Project Concepts ASP.NET MVC Key Features MVC vs WebForms Conclusion
  4. 4. ABOUT MVC PATTERN
  5. 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. 6. Main Idea of MVC Separate view and data source View Model Controller
  7. 7. Classic MVC (Active Model) View Notify for Changes Get data Controller Model Mediator Data Source
  8. 8. Classic MVC (Passive Model) View Get data Controller Model Mediator Data Source
  9. 9. MVP View Presenter Model Mediator
  10. 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
  11. 11. ASP.NET PLATFORM
  12. 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. 13. ASP.NET MVC Key Versions ASP.NET MVC 3 2011 ASP.NET MVC 2 2010 ASP.NET MVC 1 2009 ASP.NET
  14. 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.
  15. 15. SAMPLE APPLICATION
  16. 16. Concept Project name: “Easy Reporting” Idea: time tracking system for developers
  17. 17. Key Use Casesuc Use Case Report w orking time Confirm dev elopers w orking time Dev eloper Manager Manage proj ects Manage tasks
  18. 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. 19. BASIC CONCEPTS OF MVC PROJECT
  20. 20. Typical MVC Project Structure
  21. 21. Simple Controller and Action ProjectController.cs Controller Action
  22. 22. Simple View Index.cshtml
  23. 23. Simple Client Page
  24. 24. MVC Implementation Mediator Controller Client View Action Model
  25. 25. ASP.NET MVC KEY FEATURES
  26. 26. Action Results ActionResult – base class of result of an action  View  File  Redirect  HTTP  JavaScript  Content  Json  Empty
  27. 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. 28. Action Filters: Example ProjectController.cs
  29. 29. View Engines Concept Razor ASP.NET MVC *.aspx / *.ascx / *.master Etc.
  30. 30. Passing data into View Model ViewData Action View ViewBag TempData
  31. 31. HTML Helpers HTML Helper – “server control” in ASP.NET MVC Classic HTML Helpers Declarative HTML Helpers
  32. 32. Partial Views Partial view – “user control” in ASP.NET MVC _Layout.cshtml Header.cshtml Footer.cshtml
  33. 33. Layout pages and sections Layout page – “master page” in ASP.NET MVC Section – “ContentPlaceHolder” in ASP.NET MVC
  34. 34. Routing Controller URL Routing Client Engine Action Params Default route - /controller/action/id
  35. 35. Dependency Injection IServiceLocator Setup MvcServiceLocator Implement Controller Factory Controller Service Locator Instantiate Implementation Action Filter View
  36. 36. Unit Testing Using Testable Inversion of Control Application principle  Can be tested: – Controllers – Routes – Html helpers – UI Models – View logic – Etc.
  37. 37. MVC Control LibrariesClient Side Controls Server Side Controls  JQuery IU  Telerik  DOJO  DevExpress  Etc.  Etc.
  38. 38. MVC VS WEBFORMS
  39. 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. 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. 41. MVC Disadvantages Speed of development (particularly in early stages) … but you can win when you make changes in finished product
  42. 42. Conclusion
  43. 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.

×