BUILDING WEB APPS WITH ASP.NET MVC AND NOSQL

11,835 views

Published on

This talk guides you through building modern web applications using ASP.NET MVC and MongoDB, one of the most popular NoSQL databases.

You will learn some best practices for getting started with MVC. We’ll cover building rich-forms to accept user input. And if time permits, we might even add some client-side techniques using jQuery and MVC.

All of this will be built upon the powerful non-relational database MongoDB. We will discuss the origins of the so-called NoSQL movement and why you might choose a non-relational database over SQL Server. You’ll also see our data access layer will be built using LINQ to MongoDB.

Of course, you won’t be in for a night of PowerPoint. This talk is a series of interactive demos using Visual Studio 11, Windows 8, and C#.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total views
11,835
On SlideShare
0
From Embeds
0
Number of Embeds
2,757
Actions
Shares
0
Downloads
89
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

BUILDING WEB APPS WITH ASP.NET MVC AND NOSQL

  1. 1. NoSQL, MVC, and Rich Formsby Michael Kennedy | @mkennedy | michaelckennedy.net DEVELOPMENTOR
  2. 2. Introduction * Introduction to NoSQL * Why NoSQL * CRUD with NoSQL databases * HTML Helpers * Model Binding * Unobtrusive Validation * Unified Client and Server Validation * View Models * JavaScript-Friendly Environment * Single-Page Applications (MVC 4)● DEVELOPMENTOR
  3. 3. Whats Your Experience with NoSQL? DEVELOPMENTOR
  4. 4. What is NoSQL? The NoSQL movement is about re-evaluating the constraints and scalability of data storage systems in the light of the way modern web applications generate and consume data. DEVELOPMENTOR
  5. 5. What is NoSQL? The NoSQL movement is about re-evaluating the constraints and scalability of data storage systems in the light of the way modern web applications generate and consume data. DEVELOPMENTOR
  6. 6. Why NoSQL? Starting from an RDBMS is virtually an axiom of software development. When was the last time you consciously evaluated alternatives to an RDBMS?Axiom: A proposition whose truth isso evident that no reasoning ordemonstration can make it plainer. DEVELOPMENTOR
  7. 7. Why NoSQL? You can keep your ‘object / relational impedance mismatch’, thank you very much! DEVELOPMENTOR
  8. 8. MongoDB:A Powerful NoSQL Database Combining the best features of document databases, key-values stores, and RDBMS. http://www.mongodb.org/ DEVELOPMENTOR
  9. 9. MongoDB:Just an Example DEVELOPMENTOR
  10. 10. Is NoSQL only for Start-ups? DEVELOPMENTOR
  11. 11. Is NoSQL only for Start-ups? DEVELOPMENTOR
  12. 12. Getting Started DEVELOPMENTOR
  13. 13. The Project: Amazoon DEVELOPMENTOR
  14. 14. The Data Model: Amazoon DEVELOPMENTOR
  15. 15. Programming NoSQL Find several provider libraries on NuGet, including the Official 10Gen C# driver. DEVELOPMENTOR
  16. 16. Demo - Part 1:Amazoon Needs a Data LayerTime to upgrade Amazoon:Amazoon needs to be able to do basic queriesand inserts / updates. DEVELOPMENTOR
  17. 17. Demo - Part 1:Amazoon Needs a Data Layer DEVELOPMENTOR
  18. 18. The GET, POST, Redirect Pattern GET /book /edit/4 2Edit data locally an ges POST dit/42 + ch /e /book t update r ec ed i data -R 2 2 /4 30 ow TP k/sh HT oo /b DEVELOPMENTOR
  19. 19. The GET, POST, Redirect Pattern1 23 4 DEVELOPMENTOR
  20. 20. Demo - Part 2:Forms, Model Binding, and HTML Helpers"Pure" HTML forms are valid but not optimal inMVC. Make use of @Html extensions. Html.BeginForm(), Html.TextBoxFor(), etc.Usually, this is far easier with Model Binding. DEVELOPMENTOR
  21. 21. Demo - Part 2:Forms, Model Binding, and HTML HelpersTime to upgrade Amazoon:Amazoon needs an admin section where wecan create categories and books. DEVELOPMENTOR
  22. 22. Demo - Part 2:Forms, Model Binding, and HTML Helpers DEVELOPMENTOR
  23. 23. Demo - Part 2:Forms, Model Binding, and HTML HelpersWell, that mostly worked. But it was clunky onseveral levels.* ViewBag is untyped and non-discoverable* Many parameters "capture" the form values* What about validation? DEVELOPMENTOR
  24. 24. Demo - Part 3:View Models and ValidationNow that we got the site working with the newfeatures, lets clean it up.* View Models (Model Binding at the next level)* Validation (is easier with View Models) DEVELOPMENTOR
  25. 25. Demo - Part 3:View Models and Validation DEVELOPMENTOR
  26. 26. Demo - Part 3:View Models and Validation DEVELOPMENTOR
  27. 27. Demo - Part 4:Adding Real Usability with Client-Side CodeTime to upgrade Amazoon (again):Comments and discussions around books.These are already in place, but the full-pagerefresh is not usable on these potentially largepages. DEVELOPMENTOR
  28. 28. Demo - Part 4:Adding Real Usability with Client-Side Code DEVELOPMENTOR
  29. 29. Demo - Part 4:Adding Real Usability with Client-Side Code DEVELOPMENTOR
  30. 30. Fully Client-Side MVC ApplicationsMVC 4 introduces the concept of Single-PageApplications (think gmail). These combinemany technologies:* MVC and ASP.NET Web API* Knockout.js* Upshot.js* HTML5 DEVELOPMENTOR
  31. 31. Fully Client-Side MVC Applicationshttp://bit.ly/sanderson-spa DEVELOPMENTOR
  32. 32. I Want My Management Tools DEVELOPMENTOR
  33. 33. Scaling-Out is Easier With NoSQLSo you say its fast, eh? What do you mean by fast? Dropping ACID with MongoDB on USTREAM DEVELOPMENTOR
  34. 34. Conclusion (MVC)Just some of the features weve explored in MVC: * HTML Helpers * Model Binding * Unobtrusive Validation * Unified Client and Server Validation * View Models * JavaScript-Friendly Environment * Single-Page Applications (MVC 4) DEVELOPMENTOR
  35. 35. Conclusion (NoSQL)Just some of the features weve explored in NoSQL: * Your database is a choice you make for each project * NoSQL => Non-relational * Strongly supports horizontal scale-out * LINQ works great DEVELOPMENTOR
  36. 36. More from DevelopMentorhttp://www.develop.com/training-courses/web * Guerrilla .NET (May 7th in Boston) * Essential ASP.NET MVC * JavaScript and jQuery * HTML5 * + lots more @mkennedy @DevelopMentor_ DEVELOPMENTOR

×