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 RC1 - Understand MVC Pattern, Concepts & Scuba Dive ASP.NET MVC

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 RC1 - Understand MVC Pattern, Concepts & Scuba Dive ASP.NET MVC (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

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 

Kürzlich hochgeladen (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 

ASP.NET MVC RC1 - Understand MVC Pattern, Concepts & Scuba Dive ASP.NET MVC

  • 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.