際際滷

際際滷Share a Scribd company logo
ASP.NET MVC
      Introduzione


Speaker: Manuel   Scapolan   web: www.manuelscapolan.it
                               mail: info@manuelscapolan.it
premessa
    solo qualche slide

                     2
Cera una volta il web

    quello dei documenti e
    dei collegamenti ipertestuali




                                            3
Cera una volta il web




bripp aiuuu gneeeep auuu ooooooo



                                          4
oggi invece 




Bruno Maia, IconTexto
http://www.icontexto.com

                           5
Request
GET http://www.google.it HTTP/1.1
           Accept: text/html, */*
          User-Agent: Mozilla/5.0
    Accept-Encoding: gzip, deflate
             Host: www.google.it




                                     HTTP/1.1 200 OK
                                     Date: Fri, 27 May 2011 01:27:20 GMT
                                     Content-Type: text/html; charset=UTF-8;
                                     expires=Sun, 26-May-2013 01:27:20 GMT;
                                     <!doctype html><html><head> 

                                     Response
Vediamo come ASP.NET MVC risponde alla richiesta di un utente

                                Ready?
                                                            7
Go!




      8
HTTP Routing




               9
Come!?
Quale metodo?
 Di che classe?
       Convention over Configuration
Controller




 {controller}nome della classe
 {action} nome del metodo
 {id} parametro opzionale



                                     11
/food/bybrand/whiskas
/food/bybrand/whiskas
/food/bybrand/whiskas
e nel metodo
    che si fa?
Model




        16
View

    il model viene passato alla view,
    che per convenzione ha lo stesso
    nome della action




                                          17
View

   La view 竪 un mix di markup e
    codice che il view engine
    trasformer in codice html da
    inviare al client




                                           18
MVC request
        in breve
in due parole

pattern   MVC
MVC non 竪 lunico modo di fare web con ASP.NET
WebForm, really?
                                                 21
Il paradigma delle WebForm




                             22
Run-Time Stack
           a confronto
Comparing Web Forms And ASP.NET MVC
                                                             (MSDN Magazine - Dino Esposito)
   Web Forms is hard to test.
   ASP.NET MVC requires you to manage the generation of HTML at a more detailed level.
   ASP.NET MVC is not the only way to get SoC in ASP.NET.
   Web Forms allows you to learn as you go.
   Viewstate can be controlled or disabled.
   Web Forms was designed to abstract the Web machinery.
   ASP.NET MVC exposes Web architecture.
   ASP.NET MVC was designed with testability and Dependency Injection in mind.
   ASP.NET MVC takes you towards a better design of the code.
   ASP.NET MVC is young and lacks a component model.
   ASP.NET MVC is not anti-Web Forms.




                                    Undisputable
                                           facts
Conclusione
Embrace HTTP and HTMLdon't hide it (Chris Tavares)
                                                 25
Thank You!   MANUEL SCAPOLAN
             website: www.manuelscapolan.it
             twitter: manuelscapolan
             e-mail: info@manuelscapolan.it

More Related Content

Viewers also liked (9)

IDC CS4Real presentation
IDC CS4Real presentationIDC CS4Real presentation
IDC CS4Real presentation
Shai Wolkomir
Entity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernateEntity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernate
Manuel Scapolan
ASP.NET
ASP.NETASP.NET
ASP.NET
Manuel Scapolan
C# e la Framework Class Library
C# e la Framework Class LibraryC# e la Framework Class Library
C# e la Framework Class Library
Manuel Scapolan
Mobile first strategy, When, why ( and why Not )
Mobile first strategy, When, why ( and why Not ) Mobile first strategy, When, why ( and why Not )
Mobile first strategy, When, why ( and why Not )
Shai Wolkomir
Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)
Manuel Scapolan
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
Melick Baranasooriya
MVC by asp.net development company in india
MVC by asp.net development company in indiaMVC by asp.net development company in india
MVC by asp.net development company in india
iFour Institute - Sustainable Learning
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
Kumar S
IDC CS4Real presentation
IDC CS4Real presentationIDC CS4Real presentation
IDC CS4Real presentation
Shai Wolkomir
Entity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernateEntity Framework 4.0 vs NHibernate
Entity Framework 4.0 vs NHibernate
Manuel Scapolan
C# e la Framework Class Library
C# e la Framework Class LibraryC# e la Framework Class Library
C# e la Framework Class Library
Manuel Scapolan
Mobile first strategy, When, why ( and why Not )
Mobile first strategy, When, why ( and why Not ) Mobile first strategy, When, why ( and why Not )
Mobile first strategy, When, why ( and why Not )
Shai Wolkomir
Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)
Manuel Scapolan
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
Kumar S

Similar to ASP.NET MVC Intro (20)

Hands on MVC - Mastering the Web
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the Web
Claudio Gandelli
Applicazioni web con Asp.Net MVC 6
Applicazioni web con Asp.Net MVC 6Applicazioni web con Asp.Net MVC 6
Applicazioni web con Asp.Net MVC 6
Michele Aponte
Asp.NET MVC Framework
Asp.NET MVC FrameworkAsp.NET MVC Framework
Asp.NET MVC Framework
DotNetMarche
Alessandro Forte - MVP vs MVC
Alessandro Forte - MVP vs MVCAlessandro Forte - MVP vs MVC
Alessandro Forte - MVP vs MVC
Alessandro Forte
ASP.NET MVC 3: se non ora, quando?
ASP.NET MVC 3: se non ora, quando?ASP.NET MVC 3: se non ora, quando?
ASP.NET MVC 3: se non ora, quando?
Giorgio Di Nardo
MVC and Struts 1
MVC and Struts 1MVC and Struts 1
MVC and Struts 1
Tarin Gamberini
Niccol嘆 Becchi: Introduzione a GWT
Niccol嘆 Becchi: Introduzione a GWTNiccol嘆 Becchi: Introduzione a GWT
Niccol嘆 Becchi: Introduzione a GWT
firenze-gtug
Model View Controller - Semplificare Il Codice E Minimizzare I Tempi
Model View Controller - Semplificare Il Codice E Minimizzare I TempiModel View Controller - Semplificare Il Codice E Minimizzare I Tempi
Model View Controller - Semplificare Il Codice E Minimizzare I Tempi
Marco Parenzan
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRail
Stefano Ottaviani
Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!
Massimo Bonanni
Model-View-ViewModel con Windows Store Apps
Model-View-ViewModel con Windows Store AppsModel-View-ViewModel con Windows Store Apps
Model-View-ViewModel con Windows Store Apps
codeblock
Asp.Net MVC 2 :: VS 2010 Community Tour
Asp.Net MVC 2 :: VS 2010 Community TourAsp.Net MVC 2 :: VS 2010 Community Tour
Asp.Net MVC 2 :: VS 2010 Community Tour
Andrea Balducci
Fe02 ria con breeze e knockout
Fe02   ria con breeze e knockoutFe02   ria con breeze e knockout
Fe02 ria con breeze e knockout
DotNetCampus
AngularJS Reinventare le applicazioni web
AngularJS  Reinventare le applicazioni webAngularJS  Reinventare le applicazioni web
AngularJS Reinventare le applicazioni web
Luca Milan
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?
Andrea Agnoletto
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
XeDotNet
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
Alessandro Forte
What's new in Asp.Net 4.5 (and WebApi)
What's new in Asp.Net 4.5 (and WebApi)What's new in Asp.Net 4.5 (and WebApi)
What's new in Asp.Net 4.5 (and WebApi)
Luca Milan
Rich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.jsRich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.js
Giorgio Di Nardo
Hands on MVC - Mastering the Web
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the Web
Claudio Gandelli
Applicazioni web con Asp.Net MVC 6
Applicazioni web con Asp.Net MVC 6Applicazioni web con Asp.Net MVC 6
Applicazioni web con Asp.Net MVC 6
Michele Aponte
Asp.NET MVC Framework
Asp.NET MVC FrameworkAsp.NET MVC Framework
Asp.NET MVC Framework
DotNetMarche
Alessandro Forte - MVP vs MVC
Alessandro Forte - MVP vs MVCAlessandro Forte - MVP vs MVC
Alessandro Forte - MVP vs MVC
Alessandro Forte
ASP.NET MVC 3: se non ora, quando?
ASP.NET MVC 3: se non ora, quando?ASP.NET MVC 3: se non ora, quando?
ASP.NET MVC 3: se non ora, quando?
Giorgio Di Nardo
Niccol嘆 Becchi: Introduzione a GWT
Niccol嘆 Becchi: Introduzione a GWTNiccol嘆 Becchi: Introduzione a GWT
Niccol嘆 Becchi: Introduzione a GWT
firenze-gtug
Model View Controller - Semplificare Il Codice E Minimizzare I Tempi
Model View Controller - Semplificare Il Codice E Minimizzare I TempiModel View Controller - Semplificare Il Codice E Minimizzare I Tempi
Model View Controller - Semplificare Il Codice E Minimizzare I Tempi
Marco Parenzan
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRail
Stefano Ottaviani
Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!Asp.net web form 4.5 - what's new!!
Asp.net web form 4.5 - what's new!!
Massimo Bonanni
Model-View-ViewModel con Windows Store Apps
Model-View-ViewModel con Windows Store AppsModel-View-ViewModel con Windows Store Apps
Model-View-ViewModel con Windows Store Apps
codeblock
Asp.Net MVC 2 :: VS 2010 Community Tour
Asp.Net MVC 2 :: VS 2010 Community TourAsp.Net MVC 2 :: VS 2010 Community Tour
Asp.Net MVC 2 :: VS 2010 Community Tour
Andrea Balducci
Fe02 ria con breeze e knockout
Fe02   ria con breeze e knockoutFe02   ria con breeze e knockout
Fe02 ria con breeze e knockout
DotNetCampus
AngularJS Reinventare le applicazioni web
AngularJS  Reinventare le applicazioni webAngularJS  Reinventare le applicazioni web
AngularJS Reinventare le applicazioni web
Luca Milan
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?
Andrea Agnoletto
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
XeDotNet
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
Alessandro Forte
What's new in Asp.Net 4.5 (and WebApi)
What's new in Asp.Net 4.5 (and WebApi)What's new in Asp.Net 4.5 (and WebApi)
What's new in Asp.Net 4.5 (and WebApi)
Luca Milan
Rich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.jsRich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.js
Giorgio Di Nardo

More from Manuel Scapolan (12)

TFS and Scrum - Lessons Learned
TFS and Scrum - Lessons LearnedTFS and Scrum - Lessons Learned
TFS and Scrum - Lessons Learned
Manuel Scapolan
Scrum? E' come fare il bucato!
Scrum? E' come fare il bucato!Scrum? E' come fare il bucato!
Scrum? E' come fare il bucato!
Manuel Scapolan
Domain Driven Design e CQRS
Domain Driven Design e CQRSDomain Driven Design e CQRS
Domain Driven Design e CQRS
Manuel Scapolan
NOSQL
NOSQLNOSQL
NOSQL
Manuel Scapolan
ASP.NET MVC 3 - Trasportare i dati nel Model
ASP.NET MVC 3 - Trasportare i dati nel ModelASP.NET MVC 3 - Trasportare i dati nel Model
ASP.NET MVC 3 - Trasportare i dati nel Model
Manuel Scapolan
JavaScript Object Oriented
JavaScript Object OrientedJavaScript Object Oriented
JavaScript Object Oriented
Manuel Scapolan
JavaScript
JavaScriptJavaScript
JavaScript
Manuel Scapolan
HTML e CSS
HTML e CSSHTML e CSS
HTML e CSS
Manuel Scapolan
Tutte le novit di ASP.NET MVC3
Tutte le novit di ASP.NET MVC3Tutte le novit di ASP.NET MVC3
Tutte le novit di ASP.NET MVC3
Manuel Scapolan
Dai delegati a LINQ con C#
Dai delegati a LINQ con C#Dai delegati a LINQ con C#
Dai delegati a LINQ con C#
Manuel Scapolan
AntiPatterns: i vizi del programmatore
AntiPatterns: i vizi del programmatoreAntiPatterns: i vizi del programmatore
AntiPatterns: i vizi del programmatore
Manuel Scapolan
OOP with C#
OOP with C#OOP with C#
OOP with C#
Manuel Scapolan
TFS and Scrum - Lessons Learned
TFS and Scrum - Lessons LearnedTFS and Scrum - Lessons Learned
TFS and Scrum - Lessons Learned
Manuel Scapolan
Scrum? E' come fare il bucato!
Scrum? E' come fare il bucato!Scrum? E' come fare il bucato!
Scrum? E' come fare il bucato!
Manuel Scapolan
Domain Driven Design e CQRS
Domain Driven Design e CQRSDomain Driven Design e CQRS
Domain Driven Design e CQRS
Manuel Scapolan
ASP.NET MVC 3 - Trasportare i dati nel Model
ASP.NET MVC 3 - Trasportare i dati nel ModelASP.NET MVC 3 - Trasportare i dati nel Model
ASP.NET MVC 3 - Trasportare i dati nel Model
Manuel Scapolan
JavaScript Object Oriented
JavaScript Object OrientedJavaScript Object Oriented
JavaScript Object Oriented
Manuel Scapolan
Tutte le novit di ASP.NET MVC3
Tutte le novit di ASP.NET MVC3Tutte le novit di ASP.NET MVC3
Tutte le novit di ASP.NET MVC3
Manuel Scapolan
Dai delegati a LINQ con C#
Dai delegati a LINQ con C#Dai delegati a LINQ con C#
Dai delegati a LINQ con C#
Manuel Scapolan
AntiPatterns: i vizi del programmatore
AntiPatterns: i vizi del programmatoreAntiPatterns: i vizi del programmatore
AntiPatterns: i vizi del programmatore
Manuel Scapolan

ASP.NET MVC Intro

  • 1. ASP.NET MVC Introduzione Speaker: Manuel Scapolan web: www.manuelscapolan.it mail: info@manuelscapolan.it
  • 2. premessa solo qualche slide 2
  • 3. Cera una volta il web quello dei documenti e dei collegamenti ipertestuali 3
  • 4. Cera una volta il web bripp aiuuu gneeeep auuu ooooooo 4
  • 5. oggi invece Bruno Maia, IconTexto http://www.icontexto.com 5
  • 6. Request GET http://www.google.it HTTP/1.1 Accept: text/html, */* User-Agent: Mozilla/5.0 Accept-Encoding: gzip, deflate Host: www.google.it HTTP/1.1 200 OK Date: Fri, 27 May 2011 01:27:20 GMT Content-Type: text/html; charset=UTF-8; expires=Sun, 26-May-2013 01:27:20 GMT; <!doctype html><html><head> Response
  • 7. Vediamo come ASP.NET MVC risponde alla richiesta di un utente Ready? 7
  • 8. Go! 8
  • 10. Come!? Quale metodo? Di che classe? Convention over Configuration
  • 11. Controller {controller}nome della classe {action} nome del metodo {id} parametro opzionale 11
  • 15. e nel metodo che si fa?
  • 16. Model 16
  • 17. View il model viene passato alla view, che per convenzione ha lo stesso nome della action 17
  • 18. View La view 竪 un mix di markup e codice che il view engine trasformer in codice html da inviare al client 18
  • 19. MVC request in breve
  • 21. MVC non 竪 lunico modo di fare web con ASP.NET WebForm, really? 21
  • 22. Il paradigma delle WebForm 22
  • 23. Run-Time Stack a confronto
  • 24. Comparing Web Forms And ASP.NET MVC (MSDN Magazine - Dino Esposito) Web Forms is hard to test. ASP.NET MVC requires you to manage the generation of HTML at a more detailed level. ASP.NET MVC is not the only way to get SoC in ASP.NET. Web Forms allows you to learn as you go. Viewstate can be controlled or disabled. Web Forms was designed to abstract the Web machinery. ASP.NET MVC exposes Web architecture. ASP.NET MVC was designed with testability and Dependency Injection in mind. ASP.NET MVC takes you towards a better design of the code. ASP.NET MVC is young and lacks a component model. ASP.NET MVC is not anti-Web Forms. Undisputable facts
  • 25. Conclusione Embrace HTTP and HTMLdon't hide it (Chris Tavares) 25
  • 26. Thank You! MANUEL SCAPOLAN website: www.manuelscapolan.it twitter: manuelscapolan e-mail: info@manuelscapolan.it