Understanding ASP.NET MVC

5,136 views

Published on

Understanding ASP.NET MVC

Published in: Technology
  • Be the first to comment

Understanding ASP.NET MVC

  1. 1. Understanding ASP.NET MVC<br />Shravan Kumar<br />Thomson Reuters<br />
  2. 2. Walk Away Knowing<br />Introduction to ASP.NET MVC<br />Digging into ASP.NET MVC<br />What’s new in ASP.NET MVC3?<br />
  3. 3. What is ASP.NET?<br />One web application<br />framework to rule them all…<br />ASP.NET<br />Caching<br />Modules<br />Globalization<br />Pages<br />Controls<br />Master Pages<br />Profile<br />Roles<br />Membership<br />Intrinsics<br />Handlers<br />Etc...<br />
  4. 4. ASP.NET WebForms<br />Presentation<br />ASP.NET CORE<br />Runtime<br />
  5. 5. WebForms is great, But it does have some weaknesses<br />
  6. 6. No real role responsibility…<br />Master Page<br />Control<br />Control<br />UI<br />Presentation Logic<br />Business Logic<br />Data Access<br />Control<br />Control<br />Page<br />Control<br />Control<br />Control<br />Control<br />Who does what?<br />How and when?<br />
  7. 7. Control abstractions can be negative…<br />
  8. 8. It isn’t easy enoughto test<br />UI<br />Logic<br />
  9. 9. How does ASP.NET MVC Differ?<br />A new Web Application Project type<br />Not a replacement for WebForms<br /> -Builds on top of ASP.NET<br />Simply an another option<br />
  10. 10. Now ASP.NET<br />ASP.NET WebForms<br />ASP.NET<br />MVC<br />Presentation<br />ASP.NET CORE<br />Runtime<br />
  11. 11. What is MVC?<br />A design pattern<br />Separation of concerns<br />Acronym for Model ● View ● Controller<br />
  12. 12. MVC<br />
  13. 13. What is MVC? <br />Controller<br />Request<br />Step 1<br />Incoming request routed to Controller<br />
  14. 14. What is MVC?<br />Controller<br />Model<br />Step 2<br />Controller processes request and creates presentation Model<br />
  15. 15. What is MVC? <br />Controller<br />View<br />Step 3<br />Model is passed to View<br />
  16. 16. What is MVC? <br />Controller<br />View<br />Step 4<br />View transforms Model into appropriate output format<br />
  17. 17. What is MVC? <br />Controller<br />View<br />Response<br />Step 5<br />Response is rendered<br />
  18. 18. THE FUN STUFF<br />Show Me Some Code!<br />
  19. 19. Framework Goals<br />Frictionless Testability<br />Tight control over <markup/><br />User/SEO friendly URLs<br />Leverage the benefits of ASP.NET<br />Conventions and Guidance<br />
  20. 20.
  21. 21. Separation of Concerns<br />Each component has one responsibility<br /><ul><li>SRP – Single Responsibility Principle
  22. 22. DRY – Don’t Repeat Yourself</li></ul>More easily testable (TDD)<br />Helps with concurrent development<br />
  23. 23. Clean URLs<br />REST-like<br />/products/update<br />/blog/posts/2008/08/12/mvc-is-cool<br />Friendlier to humans<br />/product.aspx?categoryid=123 to become<br />Becomes /products/kittens/<br />Friendlier to web crawlers<br />Search engine optimization (SEO)<br />
  24. 24. Extensible<br />Replace any component of the system<br /><ul><li>Interface-based architecture
  25. 25. Very few sealed methods / classes</li></ul>Plays well with others<br />
  26. 26. DEMO – ASP.NET MVC<br />
  27. 27. What’s New in <br />ASP.NET MVC3?<br />
  28. 28. What’s new in ASP.NET MVC 3?<br />
  29. 29. It’s Question Time!<br />
  30. 30. Be well,and stay in touchshravan.kasagoni@gmail.comhttp://theshravan.net/blogTwitter: techieshravan<br />

×