SlideShare a Scribd company logo
MVC 3
          Alessandro Mostarda
           sandro1975@fastwebnet.it
        www.alessandromostarda.com
            Fondatore DomusDotNet
                    Roma, 09 marzo 2012
Introduzione
• Cosa è Model View Controller
   – Model (Rappresentano i dati)
   – View(Interagisce con l’utente attraverso pagine web)
   – Controller(Ha la responsabilità di caricare il model e view)



                                      Model

  Request         Controller                             Response


                                           View




                                                                    2
MVC3 vs WebForms
• MVC3 - Vantaggi
   –   Maggior controllo dell’Html
   –   Forte separazione delle responsabilità
   –   Unit testing dei controller
   –   Sistema completamente pluggabile
• Web Forms - Vantaggi
   – Semplicità di sviluppo
   – Realizzazione applicazioni intranet
   – Realizzazione piccole applicazioni e che non necessitano di estendersi
     in futuro
   – Conoscenze limitate di Javascript e Html del Team di sviluppo



                                                                              3
Struttura di un progetto
• Le cartelle di default di un progetto MVC3
   – Models
   – Controllers
       • Action
   – Views
       • Shared folder




                                               4
Controllers ed Action
• Creare un Controller
   – Ereditare dalla classe Controller
• Actions methods
• Actions results
                                                TIPO             Metodo Del Controller
                               Viewresult              View
                               PartialViewResult       PartialView
                                                       RedirectToAction RedirectToActionPermanent
                               RedirectToRouteResult
                                                       RedirectToRoute RedirectToRoutePermanent
                               RedirectResult          Redirect
                               ContentResult           Content
                               FileResult              File
                               JsonResult              Json
                               JavascriptResult        Javascript
                               HttpUnauthrizedResult   -
                               HttpNotFoundResult      HttpNotFound
                               httpStatusCodeResult    -
                               EmptyResult             -




                                                                                                    5
Views
• La view è la pagina HTML che viene renderizzata al client
• La partial view è paragonabile ad uno UserControl di
  WebForms
• Templates
   – Editor (Consentono un unico modello di visualizzazione, per un tipo
     specifico, da utilizzare nell’editing dei dati)
   – Display(Consentono un unico modello di visualizzazione, per uno
     specifico tipo, da utilizzare nella visualizzazione dei dati)




                                                                           6
Un grazie a.....

More Related Content

Similar to We Want Web - Web Applications con MVC 3

MVC and Struts 1
MVC and Struts 1MVC and Struts 1
MVC and Struts 1
Tarin Gamberini
 
Web dynpro for abap 02
Web dynpro for abap 02Web dynpro for abap 02
Web dynpro for abap 02
Piergiorgio Bossù
 
Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9
Stefano Benedetti
 
Zend Framework Workshop Parte1
Zend Framework Workshop Parte1Zend Framework Workshop Parte1
Zend Framework Workshop Parte1massimiliano.wosz
 
ASP.NET MVC: sfruttare la piattaforma al 100%
ASP.NET MVC: sfruttare la piattaforma al 100%ASP.NET MVC: sfruttare la piattaforma al 100%
ASP.NET MVC: sfruttare la piattaforma al 100%
DomusDotNet
 
Web Api – The HTTP Way
Web Api – The HTTP WayWeb Api – The HTTP Way
Web Api – The HTTP WayLuca Milan
 
Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)
Fabio Armani
 
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
 
SUE AGILE Framework (Italiano)
SUE AGILE Framework (Italiano)SUE AGILE Framework (Italiano)
SUE AGILE Framework (Italiano)
Sabino Labarile
 
Mvvm
MvvmMvvm
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, PiacenzaSviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Marco Breveglieri
 
Yii Framework - yes it is rapid web application development (Parte 1)
Yii Framework - yes it is rapid web application development (Parte 1)Yii Framework - yes it is rapid web application development (Parte 1)
Yii Framework - yes it is rapid web application development (Parte 1)
brossi676
 
ASP.NET MVC: Andare oltre il 100% (Web@work)
ASP.NET MVC: Andare oltre il 100% (Web@work)ASP.NET MVC: Andare oltre il 100% (Web@work)
ASP.NET MVC: Andare oltre il 100% (Web@work)
Giorgio Di Nardo
 
Cert04 70-484 - essentials of developing windows store apps
Cert04   70-484 - essentials of developing windows store appsCert04   70-484 - essentials of developing windows store apps
Cert04 70-484 - essentials of developing windows store appsDotNetCampus
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webLuca Milan
 
m-v-vm @ UgiAlt.Net
m-v-vm @ UgiAlt.Netm-v-vm @ UgiAlt.Net
m-v-vm @ UgiAlt.Net
Mauro Servienti
 
Moduli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarliModuli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarli
Stefano Valle
 
Cert03 70-486 developing asp.net mvc 4 web applications
Cert03   70-486 developing asp.net mvc 4 web applicationsCert03   70-486 developing asp.net mvc 4 web applications
Cert03 70-486 developing asp.net mvc 4 web applicationsDotNetCampus
 
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
 
Niccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWTNiccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWT
firenze-gtug
 

Similar to We Want Web - Web Applications con MVC 3 (20)

MVC and Struts 1
MVC and Struts 1MVC and Struts 1
MVC and Struts 1
 
Web dynpro for abap 02
Web dynpro for abap 02Web dynpro for abap 02
Web dynpro for abap 02
 
Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9
 
Zend Framework Workshop Parte1
Zend Framework Workshop Parte1Zend Framework Workshop Parte1
Zend Framework Workshop Parte1
 
ASP.NET MVC: sfruttare la piattaforma al 100%
ASP.NET MVC: sfruttare la piattaforma al 100%ASP.NET MVC: sfruttare la piattaforma al 100%
ASP.NET MVC: sfruttare la piattaforma al 100%
 
Web Api – The HTTP Way
Web Api – The HTTP WayWeb Api – The HTTP Way
Web Api – The HTTP Way
 
Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)Design Patterns - enterprise patterns (part I)
Design Patterns - enterprise patterns (part I)
 
Hands on MVC - Mastering the Web
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the Web
 
SUE AGILE Framework (Italiano)
SUE AGILE Framework (Italiano)SUE AGILE Framework (Italiano)
SUE AGILE Framework (Italiano)
 
Mvvm
MvvmMvvm
Mvvm
 
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, PiacenzaSviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
 
Yii Framework - yes it is rapid web application development (Parte 1)
Yii Framework - yes it is rapid web application development (Parte 1)Yii Framework - yes it is rapid web application development (Parte 1)
Yii Framework - yes it is rapid web application development (Parte 1)
 
ASP.NET MVC: Andare oltre il 100% (Web@work)
ASP.NET MVC: Andare oltre il 100% (Web@work)ASP.NET MVC: Andare oltre il 100% (Web@work)
ASP.NET MVC: Andare oltre il 100% (Web@work)
 
Cert04 70-484 - essentials of developing windows store apps
Cert04   70-484 - essentials of developing windows store appsCert04   70-484 - essentials of developing windows store apps
Cert04 70-484 - essentials of developing windows store apps
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni web
 
m-v-vm @ UgiAlt.Net
m-v-vm @ UgiAlt.Netm-v-vm @ UgiAlt.Net
m-v-vm @ UgiAlt.Net
 
Moduli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarliModuli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarli
 
Cert03 70-486 developing asp.net mvc 4 web applications
Cert03   70-486 developing asp.net mvc 4 web applicationsCert03   70-486 developing asp.net mvc 4 web applications
Cert03 70-486 developing asp.net mvc 4 web applications
 
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
 
Niccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWTNiccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWT
 

More from DomusDotNet

Application lifecycle management ... e quindi
Application lifecycle management ... e quindiApplication lifecycle management ... e quindi
Application lifecycle management ... e quindi
DomusDotNet
 
Unit testing in Visual Studio 2013
Unit testing in Visual Studio 2013Unit testing in Visual Studio 2013
Unit testing in Visual Studio 2013
DomusDotNet
 
Advanced ef code first 5.0 - EF@work
Advanced ef code first 5.0 - EF@workAdvanced ef code first 5.0 - EF@work
Advanced ef code first 5.0 - EF@work
DomusDotNet
 
Push Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background AgentPush Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background Agent
DomusDotNet
 
Sviluppare per Intel® Ultrabook™
Sviluppare per Intel® Ultrabook™Sviluppare per Intel® Ultrabook™
Sviluppare per Intel® Ultrabook™
DomusDotNet
 
ALM@Work - Team collaboration with visual studio alm 2012
ALM@Work - Team collaboration with visual studio alm 2012ALM@Work - Team collaboration with visual studio alm 2012
ALM@Work - Team collaboration with visual studio alm 2012
DomusDotNet
 
ALM@Work - Lab management for everyone
ALM@Work - Lab management for everyoneALM@Work - Lab management for everyone
ALM@Work - Lab management for everyone
DomusDotNet
 
ALM@Work - Continuous delivery 101
ALM@Work - Continuous delivery 101ALM@Work - Continuous delivery 101
ALM@Work - Continuous delivery 101
DomusDotNet
 
ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012
DomusDotNet
 
ALM@Work - Typical developer day
ALM@Work - Typical developer dayALM@Work - Typical developer day
ALM@Work - Typical developer day
DomusDotNet
 
WeWantWeb - WCF Data Services
WeWantWeb - WCF Data ServicesWeWantWeb - WCF Data Services
WeWantWeb - WCF Data Services
DomusDotNet
 
ALM Revolutions - Non si vive di solo check-out e check-in
ALM Revolutions - Non si vive di solo check-out e check-inALM Revolutions - Non si vive di solo check-out e check-in
ALM Revolutions - Non si vive di solo check-out e check-in
DomusDotNet
 
ALM Revolutions - Process Template Customization
ALM Revolutions - Process Template CustomizationALM Revolutions - Process Template Customization
ALM Revolutions - Process Template Customization
DomusDotNet
 
ALM Revolutions - What's new in visual studio ALM 11
ALM Revolutions - What's new in visual studio ALM 11ALM Revolutions - What's new in visual studio ALM 11
ALM Revolutions - What's new in visual studio ALM 11
DomusDotNet
 
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
Pomeriggio Entity Framework - WP7 e SQL Compact EditionPomeriggio Entity Framework - WP7 e SQL Compact Edition
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
DomusDotNet
 
Pomeriggio Entity Framework - Code First
Pomeriggio Entity Framework - Code FirstPomeriggio Entity Framework - Code First
Pomeriggio Entity Framework - Code First
DomusDotNet
 

More from DomusDotNet (16)

Application lifecycle management ... e quindi
Application lifecycle management ... e quindiApplication lifecycle management ... e quindi
Application lifecycle management ... e quindi
 
Unit testing in Visual Studio 2013
Unit testing in Visual Studio 2013Unit testing in Visual Studio 2013
Unit testing in Visual Studio 2013
 
Advanced ef code first 5.0 - EF@work
Advanced ef code first 5.0 - EF@workAdvanced ef code first 5.0 - EF@work
Advanced ef code first 5.0 - EF@work
 
Push Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background AgentPush Notification, Live Tile e Background Agent
Push Notification, Live Tile e Background Agent
 
Sviluppare per Intel® Ultrabook™
Sviluppare per Intel® Ultrabook™Sviluppare per Intel® Ultrabook™
Sviluppare per Intel® Ultrabook™
 
ALM@Work - Team collaboration with visual studio alm 2012
ALM@Work - Team collaboration with visual studio alm 2012ALM@Work - Team collaboration with visual studio alm 2012
ALM@Work - Team collaboration with visual studio alm 2012
 
ALM@Work - Lab management for everyone
ALM@Work - Lab management for everyoneALM@Work - Lab management for everyone
ALM@Work - Lab management for everyone
 
ALM@Work - Continuous delivery 101
ALM@Work - Continuous delivery 101ALM@Work - Continuous delivery 101
ALM@Work - Continuous delivery 101
 
ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012
 
ALM@Work - Typical developer day
ALM@Work - Typical developer dayALM@Work - Typical developer day
ALM@Work - Typical developer day
 
WeWantWeb - WCF Data Services
WeWantWeb - WCF Data ServicesWeWantWeb - WCF Data Services
WeWantWeb - WCF Data Services
 
ALM Revolutions - Non si vive di solo check-out e check-in
ALM Revolutions - Non si vive di solo check-out e check-inALM Revolutions - Non si vive di solo check-out e check-in
ALM Revolutions - Non si vive di solo check-out e check-in
 
ALM Revolutions - Process Template Customization
ALM Revolutions - Process Template CustomizationALM Revolutions - Process Template Customization
ALM Revolutions - Process Template Customization
 
ALM Revolutions - What's new in visual studio ALM 11
ALM Revolutions - What's new in visual studio ALM 11ALM Revolutions - What's new in visual studio ALM 11
ALM Revolutions - What's new in visual studio ALM 11
 
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
Pomeriggio Entity Framework - WP7 e SQL Compact EditionPomeriggio Entity Framework - WP7 e SQL Compact Edition
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
 
Pomeriggio Entity Framework - Code First
Pomeriggio Entity Framework - Code FirstPomeriggio Entity Framework - Code First
Pomeriggio Entity Framework - Code First
 

We Want Web - Web Applications con MVC 3

  • 1. MVC 3 Alessandro Mostarda sandro1975@fastwebnet.it www.alessandromostarda.com Fondatore DomusDotNet Roma, 09 marzo 2012
  • 2. Introduzione • Cosa è Model View Controller – Model (Rappresentano i dati) – View(Interagisce con l’utente attraverso pagine web) – Controller(Ha la responsabilità di caricare il model e view) Model Request Controller Response View 2
  • 3. MVC3 vs WebForms • MVC3 - Vantaggi – Maggior controllo dell’Html – Forte separazione delle responsabilità – Unit testing dei controller – Sistema completamente pluggabile • Web Forms - Vantaggi – Semplicità di sviluppo – Realizzazione applicazioni intranet – Realizzazione piccole applicazioni e che non necessitano di estendersi in futuro – Conoscenze limitate di Javascript e Html del Team di sviluppo 3
  • 4. Struttura di un progetto • Le cartelle di default di un progetto MVC3 – Models – Controllers • Action – Views • Shared folder 4
  • 5. Controllers ed Action • Creare un Controller – Ereditare dalla classe Controller • Actions methods • Actions results TIPO Metodo Del Controller Viewresult View PartialViewResult PartialView RedirectToAction RedirectToActionPermanent RedirectToRouteResult RedirectToRoute RedirectToRoutePermanent RedirectResult Redirect ContentResult Content FileResult File JsonResult Json JavascriptResult Javascript HttpUnauthrizedResult - HttpNotFoundResult HttpNotFound httpStatusCodeResult - EmptyResult - 5
  • 6. Views • La view è la pagina HTML che viene renderizzata al client • La partial view è paragonabile ad uno UserControl di WebForms • Templates – Editor (Consentono un unico modello di visualizzazione, per un tipo specifico, da utilizzare nell’editing dei dati) – Display(Consentono un unico modello di visualizzazione, per uno specifico tipo, da utilizzare nella visualizzazione dei dati) 6