Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Urine for a Treat (or: ASP.NET MVC)
-
Upload
joey-devilla -
Category
Technology
-
view
3.091 -
download
2
description
Transcript of Urine for a Treat (or: ASP.NET MVC)
![Page 1: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/1.jpg)
Urine for a Treat(or: ASP.NET MVC)
Barry Gervin, ObjectSharpand
Joey deVilla, Microsoft
![Page 2: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/2.jpg)
![Page 3: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/3.jpg)
![Page 4: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/4.jpg)
First came ASP…
![Page 5: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/5.jpg)
![Page 6: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/6.jpg)
…then cameASP.NET…
![Page 7: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/7.jpg)
![Page 8: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/8.jpg)
…and now,ASP.NET MVC
![Page 9: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/9.jpg)
![Page 10: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/10.jpg)
Model-View-Controller
![Page 11: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/11.jpg)
ASP.NET MVC’s MVCControllerHandles input(HTTP requests)
ViewVisually representsthe model
Request
View
Controller
Response
ModelDoes the thinkin’and persistence
![Page 12: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/12.jpg)
Routing
![Page 13: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/13.jpg)
mysite.com/object/action/parameter
![Page 14: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/14.jpg)
ConventionOver
Configuration
![Page 15: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/15.jpg)
![Page 16: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/16.jpg)
![Page 17: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/17.jpg)
Testability
![Page 18: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/18.jpg)
Master of Your Domain
![Page 19: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/19.jpg)
ASP.NETtyGoodness
Baked Right In
![Page 20: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/20.jpg)
ASP.NET Runtime
ASP.NET MVC
![Page 21: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/21.jpg)
![Page 22: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/22.jpg)
Microsoft.com/web
![Page 23: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/23.jpg)
Web Platform Installer
![Page 24: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/24.jpg)
RunPee.com (Yes, it’s a real site!)
![Page 25: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/25.jpg)
MovieWhizz
![Page 26: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/26.jpg)
![Page 27: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/27.jpg)
“Classic” ASP.NET vs.ASP.NET MVC
![Page 28: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/28.jpg)
ComparingRuby on Rails
andASP.NET MVC
![Page 29: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/29.jpg)
![Page 30: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/30.jpg)
David Heinemeier Hansson
![Page 31: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/31.jpg)
The “Gang of Foreheads”
![Page 32: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/32.jpg)
Programming Language
ASP.NET• C# or Visual Basic• Compiled• Statically typed• Java-esque syntax• Strongly tied to
Visual Studio IDE
Ruby on Rails• Ruby• Interpreted• Dynamically typed• Smalltalk-y, Perl-y,
Lisp-y syntax• Culturally tied to
TextMate
![Page 33: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/33.jpg)
Design Philosophy
ASP.NET• There really should
be a form of ASP.NET that actually treats the Web like the Web
• “Whatever, man.”• Built as a general
purpose framework for web developers using ASP.NET as a base
Ruby on Rails• There really should be
a Web programming framework that maximizes joy
• “There’s a right way to do things, and it’s this way.”
• Extracted from commonalities in 37Signals projects
![Page 34: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/34.jpg)
Database
ASP.NET• “SQL! Whoooo!”• More exposure to the
database• Typically, you build a
Repository class to act as a go-between for your models and the database
• Traditional database building
Ruby on Rails• “SQL! Ewwww!”• DHH’s opinion is that
the database is just storage
• Database persistence is provided by the model
• Database building through migrations
![Page 35: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/35.jpg)
Out soon: ASP.NET MVC 2
• A good number of new features including:– Client-side validation based on the
model’s validation metadata– Areas to better organize an application–Model validation providers to hook in
alternative validation logic when model binding
–Metadata providers to allow for alternative sources of metadata for model objects
![Page 36: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/36.jpg)
ASP.NET MVC as Seen by a Former Rails Guy, Techincally
• Really fast runtime performance!• Could stand to be a little more
“opinionated”• Coming from the world of ActiveRecord, the
“M” in MVC feels like it should be short for “Missing”
• More lines of code, but Visual Studio’s Intellisense help compensate for that
• Where are my plugins?• Could go either way on the lack of RJS
![Page 37: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/37.jpg)
ASP.NET MVC as Seen by a Former Rails Guy, Culturally
• Yes, this isn’t the first MVC framework, but the world is a better place when people take a good idea and run with it
• Moving from Rails to ASP.NET MVC, I kind of miss that Indie Rock feeling, but I like the Arena Rock opportunities
• “I’m not selling out, I’m buying in!”
![Page 38: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/38.jpg)
Resources
![Page 39: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/39.jpg)
NerdDinner (nerddinner.com)
![Page 40: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/40.jpg)
Professional ASP.NET MVC 1.0,a.k.a. The “Gang of Foreheads” Book
![Page 41: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/41.jpg)
ASP.NET MVC in Action(Follow @ManningBooks on
Twitter)
![Page 42: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/42.jpg)
Pro ASP.NET MVC Framework(Highest rating on
Amazon.com)
![Page 43: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/43.jpg)
The Official ASP.NET MVC SiteASP.NET/MVC
![Page 44: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/44.jpg)
You’ve Been Haacked (Phil Haack)
Haacked.com
![Page 45: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/45.jpg)
Scott Hanselman’s BlogHanselman.com
![Page 46: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/46.jpg)
ASP.NET MVC aggregator siteASPDotNetMVC.com
![Page 47: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/47.jpg)
This site will pull downthe pants of your mind
![Page 48: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/48.jpg)
ObjectSharpObjectSharp.com
![Page 49: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/49.jpg)
Canadian Developer Connection
blogs.msdn.com/cdndevs
![Page 50: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/50.jpg)
Global NerdyGlobalNerdy.com
![Page 51: Urine for a Treat (or: ASP.NET MVC)](https://reader033.fdocuments.us/reader033/viewer/2022061216/54b3b26a4a7959994b8b46a0/html5/thumbnails/51.jpg)
Thank You