際際滷

際際滷Share a Scribd company logo
ASP.Net MVC 3 - Basics
    Saravanan Subburayal

           07/02/2012




                           1
   Take away
   MVC Pattern
   ASP.Net MVC  Who Am I?
   ASP.Net MVC Goals
   ASP.Net Web forms vs MVC
   ASP.Net MVC - Execution process
   ASP.Net MVC Project structure
   Routing basics
   Controller
   View
   Model
   Whats Next?


                                      2
   Understanding MVC pattern
   Appreciate MVC in ASP.Net MVC
   Difference with Web forms
   Understanding of routing
   Understanding Model, View, Controller
   Understanding the request handling pipe line
    (execution process)




                                                   3
   Architectural pattern
   SoC (Separation of Concerns)
   1979  Trygve Reenskaug, Smalltalk-80
    class library
   M(Model)  V (View)  C (Controller)




                                            4
 Domain Logic
                  Data persistence



 Presentation
 (look & feel)
                         Flow control




                                         5
   Spread everywhere
       Ruby  RoR, PureMVC
       .Net  Sprint.Net, MonoRail, ASP.Net MVC
       Java  Swing, Struts, Sprintg
       Python  Django, PureMVC
       Apple  Cocoa, Cocoa touch




                                                   6
   New way of developing ASP.Net web pages
   Light weight and highly testable
    presentation framework
   Built on top of ASP.Net engine

         ASP.Net Web Form     ASP.Net MVC


                 ASP.Net Core engine


                    .Net framework


                                              7
   SoC
   Pluggability
   Easily testable (TDD)
   Friendly URLs (www.abc.com/home/contact)
   Extending ASP.Net (retain existing features)
   Full control of HTML




                                                   8
ASP.Net Web forms                  ASP.Net MVC
Event driven                       Model driven

Used Page controller pattern       Uses Front controller pattern

Supports ASP.Net Server controls   Supports raw HTML/JS

Automatic state management         Manual state manaement
(Viewstate and Postback)
Faster development (RAD)           Distributed development

TDD is difficult                   TDD is easier

UI and logic tightly coupled       Loosely coupled, Pluggability

Complex URLs                       Rest based URLs



                                                                   9
Web
                                Response
   request

          Input

UrlRoutingModul
                                   View
        e

Selects


 RouteHandler                   View Engine

          Creates


  MvcHandler                      Result

Creates              Invokes
                                     Generates


   Controller                    Action

                    Operation




                                                 10
11
for Physical store data
 Scripts, CSS, Images


                             Classes for controllers
Classes for domain logic



aspx, ascx, cshtml, mast   for script files(AJAX, Jquery)
           er


                                  Routing table


    Unit test cases




                                                            12
   Routes Browser requests to Controller actions
   Uses route table to handle incoming requests
   Route table is available in Global.asax
   Application_start() -> RegisterRoutes()     -
    >RouteTable




                                                    13
   Default route breaks requests into 3
    segments
    1. Controller
    2. Action
    3. Parameter



        http://localhost/Home/About/3

       http://localhost   Home         About     3
                          Controller   Action Parameter


                                                          14
   ? http://localhost/student
   ? http://localhost/




                                 15
   Controls the way user interacts with app
   Contains flow control logic
   Selects the view to render
   Sending Model and information for a
    particular view
   Making decisions for UI, redirection, security..
   It is a C# class
   Contains Actions(Methods)
   Eg., HomeController.cs


                                                       16
   Contains HTML markup and content
   Contains logic relevant to generating UI
   Equivalent of a Page (ASP.Net web form)
   View path should map to controller actions
     HomeController.Index() =>
      ViewHomeIndex.aspx
   Eg., Index.aspx, About.aspx




                                                 17
   It contains
       Model
       Business logic
       Validation logic
       Data access logic




                            18
19
Ad

Recommended

PPTX
Java online training
Vikram Prasad
PPTX
Advance java session 13
Smita B Kumar
PPT
Struts(mrsurwar) ppt
mrsurwar
PPT
Mule with spring security manager
Son Nguyen
PDF
Struts Basics
Harjinder Singh
PDF
Step by Step Guide for building a simple Struts Application
elliando dias
PDF
Introduction to Struts 1.3
Ilio Catallo
PPTX
Struts introduction
Muthukumaran Subramanian
PDF
276626961 java-j2 ee-course-curriculum-modular
sloumaallagui1
ODP
servlets and jsp
sachin kumbhojkar
PPTX
Spring mvc
Hui Xie
PPT
Zend framework 02 - mvc
Tricode (part of Dept)
PPT
Struts
s4al_com
PPTX
Sftplite
sivachandra mandalapu
PPTX
Mock component in munit
sivachandra mandalapu
PPTX
Jms selector
sivachandra mandalapu
PPT
Chap4 4 2
Hemo Chella
PDF
SpringMVC
Akio Katayama
PPTX
How to use splitter component
RaviRajuRamaKrishna
PPTX
Object store
sivachandra mandalapu
PDF
JBoss AS7 web services
alepalin
PPTX
Modern Java Web Development
zenyk
PPTX
Mule flow complete
Son Nguyen
PPTX
How to use smtp endpoint
sivachandra mandalapu
PDF
Ch. 13 filters and wrappers
Manolis Vavalis
PPTX
RubyConf Bangladesh 2017 - Rails buggy code
Ruby Bangladesh
PPTX
Basic example using for each component
prudhvivreddy
PPTX
Asp.Net Mvc
micham
PPTX
Introduction to ASP.Net MVC
Sagar Kamate
PDF
Asp.net difference faqs- 8
Umar Ali

More Related Content

What's hot (19)

PDF
276626961 java-j2 ee-course-curriculum-modular
sloumaallagui1
ODP
servlets and jsp
sachin kumbhojkar
PPTX
Spring mvc
Hui Xie
PPT
Zend framework 02 - mvc
Tricode (part of Dept)
PPT
Struts
s4al_com
PPTX
Sftplite
sivachandra mandalapu
PPTX
Mock component in munit
sivachandra mandalapu
PPTX
Jms selector
sivachandra mandalapu
PPT
Chap4 4 2
Hemo Chella
PDF
SpringMVC
Akio Katayama
PPTX
How to use splitter component
RaviRajuRamaKrishna
PPTX
Object store
sivachandra mandalapu
PDF
JBoss AS7 web services
alepalin
PPTX
Modern Java Web Development
zenyk
PPTX
Mule flow complete
Son Nguyen
PPTX
How to use smtp endpoint
sivachandra mandalapu
PDF
Ch. 13 filters and wrappers
Manolis Vavalis
PPTX
RubyConf Bangladesh 2017 - Rails buggy code
Ruby Bangladesh
PPTX
Basic example using for each component
prudhvivreddy
276626961 java-j2 ee-course-curriculum-modular
sloumaallagui1
servlets and jsp
sachin kumbhojkar
Spring mvc
Hui Xie
Zend framework 02 - mvc
Tricode (part of Dept)
Struts
s4al_com
Mock component in munit
sivachandra mandalapu
Jms selector
sivachandra mandalapu
Chap4 4 2
Hemo Chella
SpringMVC
Akio Katayama
How to use splitter component
RaviRajuRamaKrishna
Object store
sivachandra mandalapu
JBoss AS7 web services
alepalin
Modern Java Web Development
zenyk
Mule flow complete
Son Nguyen
How to use smtp endpoint
sivachandra mandalapu
Ch. 13 filters and wrappers
Manolis Vavalis
RubyConf Bangladesh 2017 - Rails buggy code
Ruby Bangladesh
Basic example using for each component
prudhvivreddy

Similar to Asp.Net MVC3 - Basics (20)

PPTX
Asp.Net Mvc
micham
PPTX
Introduction to ASP.Net MVC
Sagar Kamate
PDF
Asp.net difference faqs- 8
Umar Ali
PPTX
ASP.NET MVC as the next step in web development
Volodymyr Voytyshyn
PDF
Mvc3 crash
Melick Baranasooriya
PPTX
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
PPTX
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
PPTX
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
PPT
ASP .net MVC
Divya Sharma
PDF
ASP.NET MVC - Whats The Big Deal
Venketash (Pat) Ramadass
PPTX
MVC 4
Vasilios Kuznos
PPTX
Day7
madamewoolf
PDF
Asp.Net Mvc Dev Days09
Bruno Matos Tavares
PPTX
Hands on with ASP.NET MVC
rahulsahay19
PPTX
Model View Controller-Introduction-Overview.pptx
MarioCaday2
PDF
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
barbuhalahdl
PPS
Introduction To Mvc
Volkan Uzun
PDF
Asp.Net MVC Framework Design Pattern
maddinapudi
PPTX
Mvc summary
Muhammad Younis
PPTX
MVC 6 Introduction
Sudhakar Sharma
Asp.Net Mvc
micham
Introduction to ASP.Net MVC
Sagar Kamate
Asp.net difference faqs- 8
Umar Ali
ASP.NET MVC as the next step in web development
Volodymyr Voytyshyn
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
ASP .net MVC
Divya Sharma
ASP.NET MVC - Whats The Big Deal
Venketash (Pat) Ramadass
Asp.Net Mvc Dev Days09
Bruno Matos Tavares
Hands on with ASP.NET MVC
rahulsahay19
Model View Controller-Introduction-Overview.pptx
MarioCaday2
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
barbuhalahdl
Introduction To Mvc
Volkan Uzun
Asp.Net MVC Framework Design Pattern
maddinapudi
Mvc summary
Muhammad Younis
MVC 6 Introduction
Sudhakar Sharma
Ad

More from Saravanan Subburayal (6)

PPTX
Devops as a service
Saravanan Subburayal
PPTX
Machine learning
Saravanan Subburayal
PPTX
Welcome to big data
Saravanan Subburayal
PDF
Azure series 2 creating a cloud service - web role
Saravanan Subburayal
PPTX
Fluent validation
Saravanan Subburayal
PPTX
Cloud - Azure an introduction
Saravanan Subburayal
Devops as a service
Saravanan Subburayal
Machine learning
Saravanan Subburayal
Welcome to big data
Saravanan Subburayal
Azure series 2 creating a cloud service - web role
Saravanan Subburayal
Fluent validation
Saravanan Subburayal
Cloud - Azure an introduction
Saravanan Subburayal
Ad

Asp.Net MVC3 - Basics

  • 1. ASP.Net MVC 3 - Basics Saravanan Subburayal 07/02/2012 1
  • 2. Take away MVC Pattern ASP.Net MVC Who Am I? ASP.Net MVC Goals ASP.Net Web forms vs MVC ASP.Net MVC - Execution process ASP.Net MVC Project structure Routing basics Controller View Model Whats Next? 2
  • 3. Understanding MVC pattern Appreciate MVC in ASP.Net MVC Difference with Web forms Understanding of routing Understanding Model, View, Controller Understanding the request handling pipe line (execution process) 3
  • 4. Architectural pattern SoC (Separation of Concerns) 1979 Trygve Reenskaug, Smalltalk-80 class library M(Model) V (View) C (Controller) 4
  • 5. Domain Logic Data persistence Presentation (look & feel) Flow control 5
  • 6. Spread everywhere Ruby RoR, PureMVC .Net Sprint.Net, MonoRail, ASP.Net MVC Java Swing, Struts, Sprintg Python Django, PureMVC Apple Cocoa, Cocoa touch 6
  • 7. New way of developing ASP.Net web pages Light weight and highly testable presentation framework Built on top of ASP.Net engine ASP.Net Web Form ASP.Net MVC ASP.Net Core engine .Net framework 7
  • 8. SoC Pluggability Easily testable (TDD) Friendly URLs (www.abc.com/home/contact) Extending ASP.Net (retain existing features) Full control of HTML 8
  • 9. ASP.Net Web forms ASP.Net MVC Event driven Model driven Used Page controller pattern Uses Front controller pattern Supports ASP.Net Server controls Supports raw HTML/JS Automatic state management Manual state manaement (Viewstate and Postback) Faster development (RAD) Distributed development TDD is difficult TDD is easier UI and logic tightly coupled Loosely coupled, Pluggability Complex URLs Rest based URLs 9
  • 10. Web Response request Input UrlRoutingModul View e Selects RouteHandler View Engine Creates MvcHandler Result Creates Invokes Generates Controller Action Operation 10
  • 11. 11
  • 12. for Physical store data Scripts, CSS, Images Classes for controllers Classes for domain logic aspx, ascx, cshtml, mast for script files(AJAX, Jquery) er Routing table Unit test cases 12
  • 13. Routes Browser requests to Controller actions Uses route table to handle incoming requests Route table is available in Global.asax Application_start() -> RegisterRoutes() - >RouteTable 13
  • 14. Default route breaks requests into 3 segments 1. Controller 2. Action 3. Parameter http://localhost/Home/About/3 http://localhost Home About 3 Controller Action Parameter 14
  • 15. ? http://localhost/student ? http://localhost/ 15
  • 16. Controls the way user interacts with app Contains flow control logic Selects the view to render Sending Model and information for a particular view Making decisions for UI, redirection, security.. It is a C# class Contains Actions(Methods) Eg., HomeController.cs 16
  • 17. Contains HTML markup and content Contains logic relevant to generating UI Equivalent of a Page (ASP.Net web form) View path should map to controller actions HomeController.Index() => ViewHomeIndex.aspx Eg., Index.aspx, About.aspx 17
  • 18. It contains Model Business logic Validation logic Data access logic 18
  • 19. 19

Editor's Notes

  • #5: Django油A complete Python web application framework. Django prefers to call its MVC implementation油MTV, for model-template-view.
  • #7: Django油A complete Python web application framework. Django prefers to call its MVC implementation油MTV, for model-template-view.