SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
WUX201 - ASP.NET MVC
ASP.NET MVC RC1
Bruno Tavares
Software Engineer @Sapo.pt
Objectives

• A session for developers

• Understating the MVC Pattern

• Understating the major concepts

• Scuba Diving on ASP.NET MVC

• Figure out scenarios where it can add value
Sometimes…

Editing/developing applications stuff makes me feel like I'm
  playing “Operation” with my daughter:

- It’s very tempting and easy to
   blend concerns…

   It’s hard to keep it simple any
   Clean…
MVC Pattern

• MVC - Model/View/Controller

• MVC is a architectural pattern
                                          Model
  for Presentation Layer

• Isolates business logic from
  user interface

• Clean Separation of Concerns
                                   View           Controller
• Highly maintainable
  applications
Model
MVC Pattern
                                               Business Entities

What is the Model?
                                                          Workflow
• Responsible for data access, data
  persistence, data processing,         Processing Data
  business rules, etc.

• Agnostic of data presentation                Access

• Responds to controller requests and
  notifies views that depend of some
  model
                                                     Database

                                        Webservice
MVC Pattern

What is the View?                                   View

                                        Model
• Responsible for presentation,
  look and feel, formatting, sorting,
                                                            Display(HTML,
  etc.                                             Render    JSON, XML,
                                                                etc)

• A Model can have multiple views
                                        Format
                                        UI Logic
What is the Controller?                                   Event




What is the Controller?
                                                  Controller
• Responsible for handling events,                          View1
                                                 Select
                                                            View2
  manipulate the model and select the   Select
                                                 Select     View3
  view;
                                        Select View


• Purpose is to receive a event and
  figure out what to do with it;
                                                          Handling event


                                                          Manipulate



                                        Model         Model            Model
What’s ASP.NET MVC RC1?

• Is the first Release Candidate (RC1)

• A new Web Project Type for ASP.NET

• Gives guidance for structuring web apps

• Convention over Configuration

• Delivers RESTfull webapplications/websites

• Extensible and Pluggable – replace any component of the
  Framework

• Is fully testable (built with TDD in mind)

• More control over your <html/>
Where’s ASP.NET going?

• Is Microsoft’s ASP .NET going anywhere?
Where’s ASP.NET going?

• ASP.NET MVC is just an option built over ASP.NET!
   – System.Web;
   – System.Web.MVC;
Choosing Between MVC and WebForms

ASP.NET Webforms:

•   Web Forms is a well-understood technology
•   Easy to get start
•   Higher abstraction over HTML
•   There are many applications where Web Forms work very well
    – Typical intranet database reporting app
    – Corporate web applications that all the focus is functionality with constraints like
      time-to-market
    – Web Application where presentation components have a lot of dependencies
      between witch others – vast marketplace of controls many of witch are extremely
      sophisticated
    – Backoffices
Choosing Between MVC and WebForms

ASP.NET MVC:

• For those who like to get dirty over HTML
• Lower level or even no abstraction over HTML
• Multiple views over the same data (Model)
• For websites and web applications that you need to have full control
  over the output
• Use cases examples:
    – Blogs engines
    – E-commerce store-front
    – Vertical front-channels
Choosing Between MVC and WebForms

                     More control over details



                                              MVC
 WebForms                    ASP.NET
                                              • Do it yourself
 • Control ecosystem         • Services
                                              • Separation of concerns
 • State management
         management          • Caching
                                              • Test Driven Development
 • Faster starting point -   • Routing
                                              • Extensibility everywhere
 drag and drop               • Localization




                     Ready-to-
                     Ready-to-use building blocks
How it works in ASP.NET?

Request




 HTTP
           Route        View    Response
Routing




                        View
          Controller
                       Engine
demo
 -Project Creation
 -Routing
How controllers and views works?
demos
 - Controllers and Views
 - ActionFilters and ResultActions
 - Build a ViewEngine
NHaml


#foo
    - foreach (var product in ViewData)
        - if (product.Category.CategoryName != null)
            %h2=product.Category.CategoryName
            - break
    %ul.productlist
        - foreach (var product in ViewData)
            %li
                = Html.Image(quot;/Content/Images/quot; + product.ProductID + quot;.jpgquot;, product.ProductName)
                .productdetail
                    =Html.ActionLink(product.ProductName, quot;Detailquot;, new { ID=product.ProductID })
                    %br
                    Price:
                    =String.Format(quot;{0:C2}quot;, product.UnitPrice)
                                          “.productdetail”
                        %span.editlink
                            (
                            =Html.ActionLink(quot;Editquot;, quot;Editquot;, new { ID=product.ProductID })
                            )

                                                    becomes
                                  <div id=”productdetail”>
Spark


<ul class=quot;productlistquot;>
 <var styles='new[] {quot;oddquot;, quot;evenquot;}'/>
 <li each=quot;var product in ViewData.Modelquot; class=quot;${styles[productIndex%2]}quot;>
   <ProductImage style='quot;float:left;quot;'/>
   <p>
   <a href=quot;/Products/Detail/${product.ProductID}quot;>${product.ProductName}</a>
   <br />
   Price: ${String.Format(quot;{0:C2}quot;, product.UnitPrice)}
   <span class=quot;editlinkquot;>
         (${Html.ActionLink[[ProductsController]](c=>c.Edit(product.ProductID), quot;Edi
   tquot;)})
   </span>
   </p>
   <div style=quot;clear:both;quot;></div>
 </li>
</ul>
         <li each=quot;var product in
         ViewData.Modelquot;
         class=quot;${styles[productIndex%2]}quot;>
What's Next in MVC?

• Enterprise scaling features
  – More control over session state
  – Asynchronous controller actions


• Lambda-based helpers
Conclusion

• Fine-grained control over HTML

• It’s extensible and pluggable – add or change for what
  you like

• Clear separation of concerns

• Testability - support for Test-Driven Development

• ASP.NET MVC is an OPTION over ASP.NET webforms
Q&A
Software em versão completa para avaliação
  Suporte técnico 24x7 para incidentes
  Acesso antecipado às versões beta
  Microsoft Office
  Software Assurance
  formação gratuita ….e muito mais.
w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / s u b s c r i c o e s
w w w. m i c r o s o f t . c o m / l e a r n i n g / m c p / o f f e r s / s e c o n d s h o t
MSDN Flash




w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / m s d n f l a s h
Participe nos próximos ciclos
   Traga Amigos a assistir e …
   …ganhe uma Xbox, trolleys e
   livros




w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / w e b c a s t s 4 s h a r e
[BI] Resort
GASP
GetCertified
GetVirtual
Mundo Móvel
PocketPT
PontoNetPT
UC’ed
ScrumPT
ZoomIn
Questionário
A sua opinião é importante!
Complete o questionário de avaliação e
devolva-
devolva-o no balcão da recepção.
Instituto Superior Técnico
Campus do Taguspark

Weitere ähnliche Inhalte

Was ist angesagt?

Wicket from Designer to Developer
Wicket from Designer to DeveloperWicket from Designer to Developer
Wicket from Designer to DeveloperMarcello Teodori
 
Rapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithRapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithUXPA International
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)Prashanth Shivakumar
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiJared Faris
 
Monster JavaScript Course - 50+ projects and applications
Monster JavaScript Course - 50+ projects and applicationsMonster JavaScript Course - 50+ projects and applications
Monster JavaScript Course - 50+ projects and applicationsLaurence Svekis ✔
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeLaurence Svekis ✔
 
Styling components with JavaScript
Styling components with JavaScriptStyling components with JavaScript
Styling components with JavaScriptbensmithett
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project ReportKodexhub
 
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...Barry Gervin
 
Styling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS EditionStyling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS Editionbensmithett
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Andreas Bovens
 

Was ist angesagt? (13)

Wicket from Designer to Developer
Wicket from Designer to DeveloperWicket from Designer to Developer
Wicket from Designer to Developer
 
Rapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithRapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris Griffith
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)
 
Django admin
Django adminDjango admin
Django admin
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript Spaghetti
 
Monster JavaScript Course - 50+ projects and applications
Monster JavaScript Course - 50+ projects and applicationsMonster JavaScript Course - 50+ projects and applications
Monster JavaScript Course - 50+ projects and applications
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
 
Styling components with JavaScript
Styling components with JavaScriptStyling components with JavaScript
Styling components with JavaScript
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...
Visual Studio 2010 Ultimate Architecture Experience : Toronto Code Camp 2010 ...
 
Styling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS EditionStyling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS Edition
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...
 
Web components
Web componentsWeb components
Web components
 

Andere mochten auch

Seven Habits Of Highly Effective Asp Net Mvc D
Seven Habits Of Highly Effective Asp Net Mvc DSeven Habits Of Highly Effective Asp Net Mvc D
Seven Habits Of Highly Effective Asp Net Mvc Dcurtismitchell
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Nir Kaufman
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practicesHenry Tao
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan Uzun
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJSNitin Pandit
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversitySyed Shanu
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your BusinessBarry Feldman
 

Andere mochten auch (10)

ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Seven Habits Of Highly Effective Asp Net Mvc D
Seven Habits Of Highly Effective Asp Net Mvc DSeven Habits Of Highly Effective Asp Net Mvc D
Seven Habits Of Highly Effective Asp Net Mvc D
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practices
 
ASP.NET 5 & MVC 6 (RC1)
ASP.NET 5 & MVC 6 (RC1)ASP.NET 5 & MVC 6 (RC1)
ASP.NET 5 & MVC 6 (RC1)
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJS
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Ähnlich wie Asp.Net Mvc Dev Days09

Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design PatternAsp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Patternmaddinapudi
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworksguestf7bc30
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed Indiarsnarayanan
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client DevelopmentTamir Khason
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformTaylor Singletary
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementationdavejohnson
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVMBoulos Dib
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistMark Fayngersh
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture Jiby John
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Railscodeinmotion
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: AndroidJitendra Kumar
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Patterngoodfriday
 
Customizing ERModernLook Applications
Customizing ERModernLook ApplicationsCustomizing ERModernLook Applications
Customizing ERModernLook ApplicationsWO Community
 

Ähnlich wie Asp.Net Mvc Dev Days09 (20)

PHP & MVC
PHP & MVCPHP & MVC
PHP & MVC
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design PatternAsp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Pattern
 
Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed India
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client Development
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Rails
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
Design Based Dev
Design Based DevDesign Based Dev
Design Based Dev
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
Customizing ERModernLook Applications
Customizing ERModernLook ApplicationsCustomizing ERModernLook Applications
Customizing ERModernLook Applications
 

Kürzlich hochgeladen

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Asp.Net Mvc Dev Days09

  • 1.
  • 2. WUX201 - ASP.NET MVC ASP.NET MVC RC1 Bruno Tavares Software Engineer @Sapo.pt
  • 3. Objectives • A session for developers • Understating the MVC Pattern • Understating the major concepts • Scuba Diving on ASP.NET MVC • Figure out scenarios where it can add value
  • 4. Sometimes… Editing/developing applications stuff makes me feel like I'm playing “Operation” with my daughter: - It’s very tempting and easy to blend concerns… It’s hard to keep it simple any Clean…
  • 5. MVC Pattern • MVC - Model/View/Controller • MVC is a architectural pattern Model for Presentation Layer • Isolates business logic from user interface • Clean Separation of Concerns View Controller • Highly maintainable applications
  • 6. Model MVC Pattern Business Entities What is the Model? Workflow • Responsible for data access, data persistence, data processing, Processing Data business rules, etc. • Agnostic of data presentation Access • Responds to controller requests and notifies views that depend of some model Database Webservice
  • 7. MVC Pattern What is the View? View Model • Responsible for presentation, look and feel, formatting, sorting, Display(HTML, etc. Render JSON, XML, etc) • A Model can have multiple views Format UI Logic
  • 8. What is the Controller? Event What is the Controller? Controller • Responsible for handling events, View1 Select View2 manipulate the model and select the Select Select View3 view; Select View • Purpose is to receive a event and figure out what to do with it; Handling event Manipulate Model Model Model
  • 9. What’s ASP.NET MVC RC1? • Is the first Release Candidate (RC1) • A new Web Project Type for ASP.NET • Gives guidance for structuring web apps • Convention over Configuration • Delivers RESTfull webapplications/websites • Extensible and Pluggable – replace any component of the Framework • Is fully testable (built with TDD in mind) • More control over your <html/>
  • 10. Where’s ASP.NET going? • Is Microsoft’s ASP .NET going anywhere?
  • 11. Where’s ASP.NET going? • ASP.NET MVC is just an option built over ASP.NET! – System.Web; – System.Web.MVC;
  • 12. Choosing Between MVC and WebForms ASP.NET Webforms: • Web Forms is a well-understood technology • Easy to get start • Higher abstraction over HTML • There are many applications where Web Forms work very well – Typical intranet database reporting app – Corporate web applications that all the focus is functionality with constraints like time-to-market – Web Application where presentation components have a lot of dependencies between witch others – vast marketplace of controls many of witch are extremely sophisticated – Backoffices
  • 13. Choosing Between MVC and WebForms ASP.NET MVC: • For those who like to get dirty over HTML • Lower level or even no abstraction over HTML • Multiple views over the same data (Model) • For websites and web applications that you need to have full control over the output • Use cases examples: – Blogs engines – E-commerce store-front – Vertical front-channels
  • 14. Choosing Between MVC and WebForms More control over details MVC WebForms ASP.NET • Do it yourself • Control ecosystem • Services • Separation of concerns • State management management • Caching • Test Driven Development • Faster starting point - • Routing • Extensibility everywhere drag and drop • Localization Ready-to- Ready-to-use building blocks
  • 15. How it works in ASP.NET? Request HTTP Route View Response Routing View Controller Engine
  • 17. How controllers and views works?
  • 18. demos - Controllers and Views - ActionFilters and ResultActions - Build a ViewEngine
  • 19. NHaml #foo - foreach (var product in ViewData) - if (product.Category.CategoryName != null) %h2=product.Category.CategoryName - break %ul.productlist - foreach (var product in ViewData) %li = Html.Image(quot;/Content/Images/quot; + product.ProductID + quot;.jpgquot;, product.ProductName) .productdetail =Html.ActionLink(product.ProductName, quot;Detailquot;, new { ID=product.ProductID }) %br Price: =String.Format(quot;{0:C2}quot;, product.UnitPrice) “.productdetail” %span.editlink ( =Html.ActionLink(quot;Editquot;, quot;Editquot;, new { ID=product.ProductID }) ) becomes <div id=”productdetail”>
  • 20. Spark <ul class=quot;productlistquot;> <var styles='new[] {quot;oddquot;, quot;evenquot;}'/> <li each=quot;var product in ViewData.Modelquot; class=quot;${styles[productIndex%2]}quot;> <ProductImage style='quot;float:left;quot;'/> <p> <a href=quot;/Products/Detail/${product.ProductID}quot;>${product.ProductName}</a> <br /> Price: ${String.Format(quot;{0:C2}quot;, product.UnitPrice)} <span class=quot;editlinkquot;> (${Html.ActionLink[[ProductsController]](c=>c.Edit(product.ProductID), quot;Edi tquot;)}) </span> </p> <div style=quot;clear:both;quot;></div> </li> </ul> <li each=quot;var product in ViewData.Modelquot; class=quot;${styles[productIndex%2]}quot;>
  • 21. What's Next in MVC? • Enterprise scaling features – More control over session state – Asynchronous controller actions • Lambda-based helpers
  • 22. Conclusion • Fine-grained control over HTML • It’s extensible and pluggable – add or change for what you like • Clear separation of concerns • Testability - support for Test-Driven Development • ASP.NET MVC is an OPTION over ASP.NET webforms
  • 23.
  • 24. Q&A
  • 25. Software em versão completa para avaliação Suporte técnico 24x7 para incidentes Acesso antecipado às versões beta Microsoft Office Software Assurance formação gratuita ….e muito mais. w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / s u b s c r i c o e s
  • 26. w w w. m i c r o s o f t . c o m / l e a r n i n g / m c p / o f f e r s / s e c o n d s h o t
  • 27. MSDN Flash w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / m s d n f l a s h
  • 28. Participe nos próximos ciclos Traga Amigos a assistir e … …ganhe uma Xbox, trolleys e livros w w w. m i c r o s o f t . c o m / p o r t u g a l / m s d n / w e b c a s t s 4 s h a r e
  • 30. Questionário A sua opinião é importante! Complete o questionário de avaliação e devolva- devolva-o no balcão da recepção.