asp.net mvc, rest, and open source software
DESCRIPTION
Presentation given at the VB/C# .NET User Group on August 28, 2008. Talk consists of ASP.NET MVC, basics of REST, and a number of open source technologies to help develop .NET software.TRANSCRIPT
ASP.NET MVCA conglomeration of design patterns, web services, and
open source software
Who am I?
Joe Fiorini
Joe Fiorini
IIS.net Community Server
Joe Fiorini
faithfulgeek
Joe Fiorini
faithfulgeek
@faithfulgeek
Joe Fiorini
faithfulgeek
@faithfulgeek
Blog: www.faithfulgeek.org
Joe Fiorini
I
Joe Fiorini
I
Joe Fiorini
Fozzie - Bichon Frisel33t h4ck3r
Separation of Concerns
Maintainable
Maintainable + Readable
Maintainable + Readable + Logical
= AWESOME!
Model
Business Objects
Encapsulate Behavior
Variety of Choices
Variety of Choices
LinqToSql
Variety of Choices
LinqToSqlSubSonic
ActiveRecord
LinqToSqlSubSonic
View
Combination of HTML/inline code
Stupid logic
Variety of Choices
ASP.NET
Variety of Choices
NVelocity
ASP.NET
Variety of Choices
NVelocity
Xslt
ASP.NET
Variety of Choices
NVelocity
Xslt
Brail
ASP.NET
NHaml
NVelocity
Xslt
Brail
ASP.NET
Controller
Integrates model & view
Responds to application’s Request
Stupid logicFat models, skinny controllers
Convention over ConfigurationClasses & Actions
Convention over ConfigurationClasses & Actions
/movies/index
public class MoviesController : Controller{...}
Convention over ConfigurationClasses & Actions
/movies/index
public class MoviesController : Controller{...}
public ActionResult Index(){...}
Routes
Map to Controller
Redefine URL paths
Redefine URL paths
/moviesvs.
/movies/index
Where to locate a resource
Where to locate a resource
/showtimes/movie/3
A resource can be...
A resource can be...ANYTHING
A resource can be...ANYTHING
A resource can be...ANYTHING
Movie
A resource can be...ANYTHING
Movie
Theater
A resource can be...ANYTHING
Movie
Theater
Showtime
A resource can be...ANYTHING
Movie
Theater
Showtime Form
A resource can be...ANYTHING
Movie
Theater
Showtime Form
XML document
A resource can be...ANYTHING
Movie
Theater
Showtime Form
XML document
JSON
URIs model resources
URIs model resources/movies/new
HTTP verbs are methods
GET /movies/4
GET /movies/4POST /movies
/movies/6 {JSONXMLHTML
text/htmltext/plain
application/pdfapplication/xml
Proper URI naming allows reuse
/api/call?method=movies.get.all
/api/call?method=movies.get.all
GET /movies
/movies/create_new
/movies/create_new
PUT /movies
/movies/get_schedule/12
/movies/get_schedule/12
GET /showtimes/movie/12
Controller constructs resources...
Shameless Plugs...
Be there!!!
What!?!?
Where we were...
A kinder, gentler blue monster
ASP.NET MVC
A true open source project!
A Real IronRuby Hero
OSS & MVC
http://svn.castleproject.org:8080/svn/castle/trunk/ActiveRecord/
Object == database row
DSL
NHibernate/ORM
svn://rubyforge.org/var/svn/ironruby
(Rough) integration with MVC
www.mvccontrib.org
http://mvccontrib.googlecode.com/svn/trunk/
http://rikmigrations.googlecode.com/svn/trunk/
Yaml
Haml
And now the moment you’ve all been waiting for....
The End