Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
-
Upload
christian-horsdal -
Category
Technology
-
view
1.298 -
download
0
description
Transcript of Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three web frameworks All .NET
One hour Go
Christian Horsdal@chr_horsdal
horsdal.blogspot.com
Thanks to the sponsors
• Lead Software Architect @ Mjølner Informatics• Denmark• Husband and Father• Some who enjoys– Clean code– TDD’ing– When Denmarks wins at football– Simplicity– Whisky
Who Am I?
• There are alternatives to ASP.NET – Even on .NET– Know them!
• Style matters
• Tradeoffs, tradeoffs, tradeoffs– Conventions <-----> explicitness– DRY <-----> separation of concerns– Abstract <-----> concrete
Why?
• Run anywhere
• IoC/DI to the bone
• Embrace HTTP
• OSS and community driven
Why?
A taste of some alternatives
• FubuMVC
• OpenRasta
• Nancy
What will you learn?
Sample
• One Model In One Model Out– Aka OMIOMO– Aka Russian Doll
• Convention over Configuration
• Really cool built-in diagnostics
• Everything is POCOs
FubuMVC – At a glance
GET “/” • No params
HomeController.get_Home
• Returns HomeViewModel
HomeView.cshtml • Takes HomeViewModel
FubuMVC – ShortUrl Overview
FubuMVC – ShortUrl Overview
POST “/” • UrlShorteningModel
HomeController.post_Home
• Takes UrlShorteningModel• Returns UrlShorteningViewModel
post_url_result.cshtml • Takes UrlShorteningVM
FubuMVC – ShortUrl Overview
GET “/42” • ShortenedUrlModel
HomeController.get_Url• Takes ShortenedUrlMode• Returns FubuContinuation
FubuMVC
Show me the code!
• Three things:– Resources– Handlers– Codecs
• Automatic conneg
• Everything is POCOs
OpenRasta– At a glance
• Resource:– “/”– “/{shortenedUrl}”– Home
GET “/” POST “/” GET “/42”
OpenRasta – Shorturl Overview
• Handler– HomeHandler
Home resourceHomeHandler
OpenRasta – Shorturl Overview
• “Codecs”– WebForms viewengine– Form data
Home resourceHomeHandler
GET “/” POST “/” GET “/42”
OpenRasta – Shorturl Overview
OpenRasta
Show me the code!
• Lightweight, low ceremony– Just works– But easily swappable– DSLs
• Built in diagnostics
• Automatic conneg
• Testability is first class
Nancy– At a glance
• Modules– ShortUrlModule
HTTP request Routes Handler
function Response
Nancy – Shorturl Overview
HTTP request Routes Handler
function Response
Nancy – Shorturl Overview
• Routes– Get[“/”]– Post[“/”]– Get[“/{shortenedUrl}”]
• A lambda for each
HTTP request Routes Handler
function Response
Nancy – Shorturl Overview
Nancy
Show me the code!
Why, again? There are alternatives to ASP.NET
Know them!
Style matters
Tradeoffs, tradeoffs, tradeoffs
• FubuMVC– OMIOMU
• OpenRasta – Resources, Handlers, Codecs
• Nancy– DSL
What might you have learned?A taste of some altenatives
WHEN, WHAT, WHERE?FubuMVC, OpenRasta, Nancy
Please rate this sessionScan the code, go online, rate this session
Christian Horsdal@chr_horsdal
horsdal.blogspot.com