SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Último (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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.