SlideShare a Scribd company logo
1 of 12
Asp.net Mvc

     Brandon D’Imperio
        bdimpe@gmail.com
    Imaginarydevelopment.com
Imaginarydevelopment.blogspot.com
What’s wrong with WebForms?
•   Web Forms allow developers to rapidly create applications simply by dragging and dropping
    controls and handling page-level events for both the page and the controls on the page. This
    works well, but it’s a high-level of abstraction and many developers completely forget—or
    never learned—how the HTML layout actually works behind the scenes. As a result, it’s
    common to end up with non-validating HTML, or bloated and hard-to-manage HTML layout
    that is very designer unfriendly. Add to that a huge amount of ViewState if you don’t
    effectively manage ViewState properly and you can easily end up with pages that are much
    bigger than they need to be and slow as molasses.

•   One downside of the Web Forms framework is that behind this abstraction layer, Microsoft
    built a very complex engine that has many side effects in the Page pipeline. If you’ve ever built
    complex pages that contain many components on the page it can sometimes get very difficult
    to coordinate the event sequence for data binding, rendering, and setup of the various
    controls at the correct time in the page cycle. Do you load data in the Init, Load or PreRender
    events or do you assign values during postback events? Web Forms need to run through a
    single server-side form so they can’t easily be broken up into smaller logical units. In complex
    forms, event handlers can get very bulky with the tasks they need to handle and often in ways
    that can’t be easily refactored so you end up with code that is difficult to maintain and
    impossible to test.

     –   Rick Strahl – MVP since 1997
Webforms?
Who uses MVC?
• StackOverflow.com
   – Serves 1.4-1.5 million hits per day. (as of May, 2010)
   – A language-independent collaboratively edited question and answer
     site for programmers. Questions and answers displayed by user votes
     and tags.
   – Alexa traffic ranked 465, 451 in the US, and 212 in India
• It's no coincidence that many of the most popular web
  programming frameworks also encapsulate MVC principles:
  Django, Ruby on Rails, CakePHP, Struts, and so forth. It's also
  officially creeping into ASP.NET under the fledgling ASP.NET
  MVC project. – Jeff Atwood of CodingHorror.com May,2008
MVC vs webforms
• ASP.net MVC
   –   Enables the full control over the rendered HTML.
   –   Provides clean separation of concerns(SoC).
   –   Enables Test Driven Development (TDD).
   –   Easy integration with JavaScript frameworks.
   –   Following the design of stateless nature of the web.
   –   RESTful urls that enables SEO.
   –   No ViewState and PostBack events
        • Lightweight/faster
   – No Codebehind
• ASP.net Web Forms
   – It provides RAD development
   – Easy development model for developers coming from winform
     development.
MVC + webforms
• You can intermix the two
• Use MVC for routing, separation, more
  javascript/jQuery friendliness
• Use webforms for complex controls that you
  are attached to or are just better for the
  situation.
• Both use some T4 style-coding
What is M.V.C?
• Model – The classes which are used to store
  and manipulate state, typically in a database
  of some kind.
• View – Your application’s presentation code or
  layer
• Controller – Wires up your model to your
  View/presentation/public interface (winforms,
  web pages, web services, soap, rest, etc..)
How does it work?
Web forms flow vs. MVC flow
Asp.net MVC with routing
User does a Get or Post to the routing
system. The routing system tries to
find a route match, and creates an
instance of the appropriate controller.
Then it invokes the Action on the
controller.

The controller invokes methods on the
model, which passes back any relevant
data used in response.

The controller then usually locates the
view and renders the view using the
data from the model (in many cases
transformed or flattened in a
ViewModel or in the controller) .
Sample Layout
       • Controllers
          – Define your externally
            visible methods/URLs
       • Models
          – Your Core code +
            persistence
       • Views
          – Pages to render
       • Global.asax (not pictured)
          – Defines routes, and other
            app-startup code
References
• What’s Ailing Asp.Net Web Forms – Rick Strahl
• http://www.codinghorror.com/blog/2008/05/
  understanding-model-view-controller.html
• http://www.aspiringcraftsman.com/2007/08/i
  nteractive-application-architecture/

More Related Content

What's hot

SharePoint 2010 Web Content Management - The Developer Story
SharePoint 2010 Web Content Management - The Developer StorySharePoint 2010 Web Content Management - The Developer Story
SharePoint 2010 Web Content Management - The Developer StoryWaldek Mastykarz
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Difference between MVC 3, 4, 5 and 6
Difference between MVC 3, 4, 5 and 6Difference between MVC 3, 4, 5 and 6
Difference between MVC 3, 4, 5 and 6Bhaumik Patel
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introductionBhagath Gopinath
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines Dev Raj Gautam
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training sessionHrichi Mohamed
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan Uzun
 
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazingMortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazingTom Walker
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCEmad Alashi
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...Idexcel Technologies
 

What's hot (20)

Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Mvc fundamental
Mvc fundamentalMvc fundamental
Mvc fundamental
 
Mvc
MvcMvc
Mvc
 
SharePoint 2010 Web Content Management - The Developer Story
SharePoint 2010 Web Content Management - The Developer StorySharePoint 2010 Web Content Management - The Developer Story
SharePoint 2010 Web Content Management - The Developer Story
 
Mvc framework
Mvc frameworkMvc framework
Mvc framework
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Difference between MVC 3, 4, 5 and 6
Difference between MVC 3, 4, 5 and 6Difference between MVC 3, 4, 5 and 6
Difference between MVC 3, 4, 5 and 6
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazingMortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
Mvc summary
Mvc summaryMvc summary
Mvc summary
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
No brainer
No brainerNo brainer
No brainer
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 

Similar to Mvc presentation

Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Mayank Srivastava
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017Innovation Studio
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part IRohit Rao
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
Lecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdfLecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdfLê Thưởng
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)Hatem Hamad
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Shiju Varghese
 

Similar to Mvc presentation (20)

MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Mvc3 part1
Mvc3   part1Mvc3   part1
Mvc3 part1
 
Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
Trinada pabolu profile
Trinada pabolu profileTrinada pabolu profile
Trinada pabolu profile
 
Mvc Brief Overview
Mvc Brief OverviewMvc Brief Overview
Mvc Brief Overview
 
Trinada pabolu profile
Trinada pabolu profileTrinada pabolu profile
Trinada pabolu profile
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
SRINATH RESUME
SRINATH RESUMESRINATH RESUME
SRINATH RESUME
 
Lecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdfLecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdf
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
 
Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
 

More from MaslowB

F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioMaslowB
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angularMaslowB
 
Js testing
Js testingJs testing
Js testingMaslowB
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
What’s new mvc 4
What’s new mvc 4What’s new mvc 4
What’s new mvc 4MaslowB
 
A clean repository pattern in ef
A clean repository pattern in efA clean repository pattern in ef
A clean repository pattern in efMaslowB
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandonMaslowB
 

More from MaslowB (9)

F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperio
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angular
 
Js testing
Js testingJs testing
Js testing
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
What’s new mvc 4
What’s new mvc 4What’s new mvc 4
What’s new mvc 4
 
A clean repository pattern in ef
A clean repository pattern in efA clean repository pattern in ef
A clean repository pattern in ef
 
Metrics
MetricsMetrics
Metrics
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandon
 

Recently uploaded

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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
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
 

Recently uploaded (20)

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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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 ...
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Mvc presentation

  • 1. Asp.net Mvc Brandon D’Imperio bdimpe@gmail.com Imaginarydevelopment.com Imaginarydevelopment.blogspot.com
  • 2. What’s wrong with WebForms? • Web Forms allow developers to rapidly create applications simply by dragging and dropping controls and handling page-level events for both the page and the controls on the page. This works well, but it’s a high-level of abstraction and many developers completely forget—or never learned—how the HTML layout actually works behind the scenes. As a result, it’s common to end up with non-validating HTML, or bloated and hard-to-manage HTML layout that is very designer unfriendly. Add to that a huge amount of ViewState if you don’t effectively manage ViewState properly and you can easily end up with pages that are much bigger than they need to be and slow as molasses. • One downside of the Web Forms framework is that behind this abstraction layer, Microsoft built a very complex engine that has many side effects in the Page pipeline. If you’ve ever built complex pages that contain many components on the page it can sometimes get very difficult to coordinate the event sequence for data binding, rendering, and setup of the various controls at the correct time in the page cycle. Do you load data in the Init, Load or PreRender events or do you assign values during postback events? Web Forms need to run through a single server-side form so they can’t easily be broken up into smaller logical units. In complex forms, event handlers can get very bulky with the tasks they need to handle and often in ways that can’t be easily refactored so you end up with code that is difficult to maintain and impossible to test. – Rick Strahl – MVP since 1997
  • 4. Who uses MVC? • StackOverflow.com – Serves 1.4-1.5 million hits per day. (as of May, 2010) – A language-independent collaboratively edited question and answer site for programmers. Questions and answers displayed by user votes and tags. – Alexa traffic ranked 465, 451 in the US, and 212 in India • It's no coincidence that many of the most popular web programming frameworks also encapsulate MVC principles: Django, Ruby on Rails, CakePHP, Struts, and so forth. It's also officially creeping into ASP.NET under the fledgling ASP.NET MVC project. – Jeff Atwood of CodingHorror.com May,2008
  • 5. MVC vs webforms • ASP.net MVC – Enables the full control over the rendered HTML. – Provides clean separation of concerns(SoC). – Enables Test Driven Development (TDD). – Easy integration with JavaScript frameworks. – Following the design of stateless nature of the web. – RESTful urls that enables SEO. – No ViewState and PostBack events • Lightweight/faster – No Codebehind • ASP.net Web Forms – It provides RAD development – Easy development model for developers coming from winform development.
  • 6. MVC + webforms • You can intermix the two • Use MVC for routing, separation, more javascript/jQuery friendliness • Use webforms for complex controls that you are attached to or are just better for the situation. • Both use some T4 style-coding
  • 7. What is M.V.C? • Model – The classes which are used to store and manipulate state, typically in a database of some kind. • View – Your application’s presentation code or layer • Controller – Wires up your model to your View/presentation/public interface (winforms, web pages, web services, soap, rest, etc..)
  • 8. How does it work?
  • 9. Web forms flow vs. MVC flow
  • 10. Asp.net MVC with routing User does a Get or Post to the routing system. The routing system tries to find a route match, and creates an instance of the appropriate controller. Then it invokes the Action on the controller. The controller invokes methods on the model, which passes back any relevant data used in response. The controller then usually locates the view and renders the view using the data from the model (in many cases transformed or flattened in a ViewModel or in the controller) .
  • 11. Sample Layout • Controllers – Define your externally visible methods/URLs • Models – Your Core code + persistence • Views – Pages to render • Global.asax (not pictured) – Defines routes, and other app-startup code
  • 12. References • What’s Ailing Asp.Net Web Forms – Rick Strahl • http://www.codinghorror.com/blog/2008/05/ understanding-model-view-controller.html • http://www.aspiringcraftsman.com/2007/08/i nteractive-application-architecture/

Editor's Notes

  1. http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx
  2. http://msdn.microsoft.com/en-us/magazine/dd252940.aspx