SlideShare a Scribd company logo
Models, Views, Controllers and all that other crazy stuff!
Models, Views, Controllers and all that other crazy stuff!
Agenda

 What is MVC?
 Questions You Might be Thinking
 Demonstration…
 Code, code, and more code!
 Questions & Answers
What is MVC?

 Concept been around since 1979
 Separation of Concerns
   “Separate content from presentation and data-
    processing (model) from content.” --Wikipedia
What is MVC?

 What do I gain from ASP.NET MVC?
     Clean separation of concerns
     Testability & TDD
     Highly extensible and pluggable
     Powerful URL mapping for clean REST-ful URLs
     Can leverage existing ASP.NET features
       Authentication, Authorization, & Roles
       Session, State Management, Output & Data Caching
       Localization, etc…
   Total control over the rendered View
What is MVC?

 What do I loose from ASP.NET MVC?
   ASP.NET Web Form post-back model
   Dependency of View State
   Initially Rich Controls may be more difficult
   Tons of HTML being generated for you
   Big learning curve for .NET Web Developers
Questions You Might Be Thinking

 Will ASP.NET MVC replace ASP.NET Web
  Forms?
 How would I go about choosing between
  using ASP.NET MVC or ASP.NET Web Forms?
 Is ASP.NET MVC ready for production?
 When will ASP.NET MVC be officially
  released?
Demonstration

 Pet Shop 5.0
 Technologies Used
   Visual Studio Team System 2008
   .NET 3.5 using C# 3.0 & LINQ to SQL
   ASP.NET MVC Preview 5
   Microsoft SQL Server 2005 Express
   jQuery v.1.2.6
     Flexigrid
     jGrowl
Sources of Inspiration

   Scott Guthrie
     http://weblogs.asp.net/Scottgu/
   Scott Hanselman
     http://www.hanselman.com/blog/
   Phil Haack
     http://haacked.com/
   Stephen Walther
     http://weblogs.asp.net/StephenWalther/
Come on… I know you have at least one question
  that you’ve been dying to ask!
Questions I thought you’d ask… #1a

   What is the difference between MVC & MVP
     And no… I’m not referring to Microsoft’s Most
      Valuable Professional (of which you can find some in
      here)
Questions I thought you’d ask… #1b

   What is the difference between MVC & MVP
     MVC
      Controller responsible for determining which view is
       displayed in response to any action.
      The view does not directly bind to the model.
      The view usually will not have any logic in the code
       behind.
     MVP
      Presenter contains the UI business logic for the view.
      All actions from the view delegate to the presenter.
      Tends to be a very natural pattern for achieving
       separated presentation in ASP.NET Web Forms.
Questions I thought you’d ask… #1c
Questions I thought you’d ask… #2

   What is the DRY Principle?
     It means “Don’t Repeat Yourself”, but it isn’t
      necessarily talking about the Copy/Paste Code
      Smell… that is better described by the “Once and
      Only Once” (OAOO) principle.
     An example of something really DRY is XSLT…
      where knowledge is not repeated.
     “The DRY code philosophy is stated as ‘Every piece
      of knowledge must have a single, unambiguous,
      authoritative representation within a system.’”
      --Wikipedia
Questions I thought you’d ask… #3

   What is the PRG Pattern?
     “…instead of returning an HTML page directly, the
      POST operation returns a redirection command…
      instructing the browser to load a different page
      using an HTTP GET request. The result page can
      then safely be bookmarked or reloaded without
      unexpected side effects.” --Wikipedia

More Related Content

What's hot (20)

What is mvc
What is mvc
Sireesh K
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net Mvc
Rishu Mehra
 
Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜
Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜
yoshiaki iwanaga
 
Knockout js with mvc
Knockout js with mvc
Joel Cochran
 
Introduce MVVM & How to implement it in your iOS app
Introduce MVVM & How to implement it in your iOS app
Harvey Hu
 
Single-page applications and Grails
Single-page applications and Grails
Alvaro Sanchez-Mariscal
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
MarkupBox
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right Choice
Dmitry Sheiko
 
Mvc
Mvc
creynders
 
MVVM Applied: From Silverlight to Windows Phone to Windows 8
MVVM Applied: From Silverlight to Windows Phone to Windows 8
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJS
Alvaro Sanchez-Mariscal
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)
IT PROGRAMMING WORLD
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
 
Knockout mvvm-m1-slides
Knockout mvvm-m1-slides
MasterCode.vn
 
The Windows Runtime and the Web
The Windows Runtime and the Web
Jeremy Likness
 
Sling models
Sling models
Ankit Gubrani
 
Node.js exception handling
Node.js exception handling
Minh Hoang
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
Julia Cherniak
 
Require JS
Require JS
Imaginea
 
Single Page Application Best practices
Single Page Application Best practices
Tarence DSouza
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net Mvc
Rishu Mehra
 
Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜
Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜
yoshiaki iwanaga
 
Knockout js with mvc
Knockout js with mvc
Joel Cochran
 
Introduce MVVM & How to implement it in your iOS app
Introduce MVVM & How to implement it in your iOS app
Harvey Hu
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
MarkupBox
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right Choice
Dmitry Sheiko
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJS
Alvaro Sanchez-Mariscal
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)
IT PROGRAMMING WORLD
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographic
InApp
 
Knockout mvvm-m1-slides
Knockout mvvm-m1-slides
MasterCode.vn
 
The Windows Runtime and the Web
The Windows Runtime and the Web
Jeremy Likness
 
Node.js exception handling
Node.js exception handling
Minh Hoang
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
Julia Cherniak
 
Require JS
Require JS
Imaginea
 
Single Page Application Best practices
Single Page Application Best practices
Tarence DSouza
 

Viewers also liked (8)

Introduction to csharp
Introduction to csharp
hmanjarawala
 
00 Fundamentals of csharp course introduction
00 Fundamentals of csharp course introduction
maznabili
 
C#, OOP introduction and examples
C#, OOP introduction and examples
agni_agbc
 
Unix Command Line Productivity Tips
Unix Command Line Productivity Tips
Keith Bennett
 
UNIX/Linux training
UNIX/Linux training
Michael Olafusi
 
8051 Microcontroller Notes
8051 Microcontroller Notes
Dr.YNM
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Introduction to csharp
Introduction to csharp
hmanjarawala
 
00 Fundamentals of csharp course introduction
00 Fundamentals of csharp course introduction
maznabili
 
C#, OOP introduction and examples
C#, OOP introduction and examples
agni_agbc
 
Unix Command Line Productivity Tips
Unix Command Line Productivity Tips
Keith Bennett
 
8051 Microcontroller Notes
8051 Microcontroller Notes
Dr.YNM
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Ad

Similar to Asp netmvc (20)

MVC Framework
MVC Framework
Ashton Feller
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Model view controller (mvc)
Model view controller (mvc)
M Ahsan Khan
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
Ian Carnaghan
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
Intro ASP MVC
Intro ASP MVC
KrishnaPPatel
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
Dev Raj Gautam
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
Rohit Rao
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
Gaurav Arora
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
Gaurav Arora
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVC
Sagar Kamate
 
ASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Asp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
LearnNowOnline
 
Mvc
Mvc
abhigad
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
MVC architecture
MVC architecture
baabtra.com - No. 1 supplier of quality freshers
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
Hatem Hamad
 
Introduction To Mvc
Introduction To Mvc
Volkan Uzun
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Mayank Srivastava
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Model view controller (mvc)
Model view controller (mvc)
M Ahsan Khan
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
Ian Carnaghan
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
AHM Pervej Kabir
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
Dev Raj Gautam
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
Rohit Rao
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
Gaurav Arora
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
Gaurav Arora
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVC
Sagar Kamate
 
ASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
LearnNowOnline
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
Hatem Hamad
 
Introduction To Mvc
Introduction To Mvc
Volkan Uzun
 
Ad

Recently uploaded (20)

BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 

Asp netmvc

  • 1. Models, Views, Controllers and all that other crazy stuff!
  • 2. Models, Views, Controllers and all that other crazy stuff!
  • 3. Agenda  What is MVC?  Questions You Might be Thinking  Demonstration…  Code, code, and more code!  Questions & Answers
  • 4. What is MVC?  Concept been around since 1979  Separation of Concerns  “Separate content from presentation and data- processing (model) from content.” --Wikipedia
  • 5. What is MVC?  What do I gain from ASP.NET MVC?  Clean separation of concerns  Testability & TDD  Highly extensible and pluggable  Powerful URL mapping for clean REST-ful URLs  Can leverage existing ASP.NET features  Authentication, Authorization, & Roles  Session, State Management, Output & Data Caching  Localization, etc…  Total control over the rendered View
  • 6. What is MVC?  What do I loose from ASP.NET MVC?  ASP.NET Web Form post-back model  Dependency of View State  Initially Rich Controls may be more difficult  Tons of HTML being generated for you  Big learning curve for .NET Web Developers
  • 7. Questions You Might Be Thinking  Will ASP.NET MVC replace ASP.NET Web Forms?  How would I go about choosing between using ASP.NET MVC or ASP.NET Web Forms?  Is ASP.NET MVC ready for production?  When will ASP.NET MVC be officially released?
  • 8. Demonstration  Pet Shop 5.0  Technologies Used  Visual Studio Team System 2008  .NET 3.5 using C# 3.0 & LINQ to SQL  ASP.NET MVC Preview 5  Microsoft SQL Server 2005 Express  jQuery v.1.2.6  Flexigrid  jGrowl
  • 9. Sources of Inspiration  Scott Guthrie  http://weblogs.asp.net/Scottgu/  Scott Hanselman  http://www.hanselman.com/blog/  Phil Haack  http://haacked.com/  Stephen Walther  http://weblogs.asp.net/StephenWalther/
  • 10. Come on… I know you have at least one question that you’ve been dying to ask!
  • 11. Questions I thought you’d ask… #1a  What is the difference between MVC & MVP  And no… I’m not referring to Microsoft’s Most Valuable Professional (of which you can find some in here)
  • 12. Questions I thought you’d ask… #1b  What is the difference between MVC & MVP  MVC  Controller responsible for determining which view is displayed in response to any action.  The view does not directly bind to the model.  The view usually will not have any logic in the code behind.  MVP  Presenter contains the UI business logic for the view.  All actions from the view delegate to the presenter.  Tends to be a very natural pattern for achieving separated presentation in ASP.NET Web Forms.
  • 13. Questions I thought you’d ask… #1c
  • 14. Questions I thought you’d ask… #2  What is the DRY Principle?  It means “Don’t Repeat Yourself”, but it isn’t necessarily talking about the Copy/Paste Code Smell… that is better described by the “Once and Only Once” (OAOO) principle.  An example of something really DRY is XSLT… where knowledge is not repeated.  “The DRY code philosophy is stated as ‘Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.’” --Wikipedia
  • 15. Questions I thought you’d ask… #3  What is the PRG Pattern?  “…instead of returning an HTML page directly, the POST operation returns a redirection command… instructing the browser to load a different page using an HTTP GET request. The result page can then safely be bookmarked or reloaded without unexpected side effects.” --Wikipedia

Editor's Notes

  • #8: 1. No, MVC will not replace Web Forms. It will only be an alternative approach for web development. Don’t be fearful that your precious post-back View State model will be taken away from you ;) 2. If you have a highly intensive user experience you may want to stay with the classic Web Form approach, however, if you find yourself in a very large enterprise you may want to consider using MVC since it provides a lot of flexibility and enables unit testing…. Something very difficult to do in a Web Form environment. 3. There are many sites that already use MVC in production, however, technically the product hasn’t been released yet. It is still in Preview 5. 4. The rumor is that MVC will be released in a month that ends in “ber”. There is no official release date that I am aware of. Since the project has been hosted on CodePlex it has had the unique experience of being tested while it is being developed. The community is helping drive the direction of the product, but with that comes a flexible delivery date. It’s done when it’s done.
  • #9: This is a test note