typemismatch

just a projection of my own imagination

  • You are here: 
  • Home
  • MVC

Rails, Grails and .NET MVC

Posted on May 3rd, 2009

We certainly do have a lot of choices when building applications these days! :) Here is a little insight into my latest project application choice. It might or might not work for you and it is not intended to be a guide per se since as good programmers know – pick what makes sense for your application.

I needed a new web application that was only going to be used for internal administration and so I could do something fun and not care about how it scales. Here are a couple key requirements so we can discuss over them. Firstly, I need page authentication and I have no need for a database since I’ll use SimpleDB so the DAL isn’t as important.

My initial thought was, lets just roll with Rails since in the last couple months I’ve been doing a lot of R&D using Ruby and Rails however I recently started some work on Grails and so the decisions begin.

Let me prefix first by saying I could have built this using .NET MVC and I believe that would have been the fastest way, sorry but it is – that isn’t bias for Microsoft just a fact especially since my skills lie heavily in that area … but I wanted something more fun :)

ASP.NET MVC

  • Easy to use for sure, especially if you’re already a .NET developer.
  • Tools are fantastic.
  • Authentication is as simple as using the [Authorize] decoration on your controllers.
  • Data is via an existing SimpleDB Provider I wrote.
  • Doesn’t run well on anything but IIS
  • No exposure to other technologies <- the fun part :)

Ruby on Rails

  • I think Ruby is pretty easy to learn.
  • The tools are getting better – don’t be a hero, use and IDE like NetBeans/Eclipse.
  • If you have complex database requirements activerecord is going to be painful for you.
  • I’ve found the community a bit broken with Rails, you can generally get help but not always the easiest to understand.
  • Far too many depreciated gems floating around and even the Rails wiki is out of date.
  • As for authentication, well nothing easy to find – does require more code than I’d like. Not sure what is best.
  • SimpleDB access was OK but not great, relative name spaces break when importing classes while using Amazon libraries so that wasn’t cool. Had to hard code some paths.

Grails

  • Just started R&D on this and I didn’t feel like jumping into Groovy although it is close to Ruby I’d rather learn one new thing at a time.
  • Does have the huge benefit of running on the JVM and also being able to use existing java classes.
  • Can be deployed on well established application servers, so that is great.
  • Tools are ok, new at this stage but Netbeans seems to do the job.
  • Authentication is ok, there is a good plugin but still requires far too much code for my liking compared to .NET
  • I can’t find a Grails/Groovy SimpleDB library but there is one for Java so I guess I can just use that.

and then I found ….

JRuby

  • Will allow me to keep on the learning curve with Ruby but
  • Lets me deploy in single packages and do java application containers.
  • Exposes me to more java technology.
  • Tools are pretty good and I’m using NetBeans right now.

So that kinda sealed the deal. I wanted something fun and like Ruby so JRuby lets me keep that knowledge but also I get better exposure to Java technologies. You might wonder, “If you want Java exposure why not use JSP or similiar” … right, no thanks :) Keep it simple!.

I’ll post when I’ve deployed my first working JRuby application and I plan to run it on Tomcat/Ubuntu 9x.

Tags: , ,
Filed under .NET, Software | 2 Comments »

MVC and Test Driven Development

Posted on December 13th, 2007

Well shortly after the release of VS 2008 Microsoft have released an MVC extension for Visual Studio. It is long overdue but never the less great to get! One funny point to note and maybe it’s just because the release is only CTP but the test framework of VS 2008 cannot test a controller out-the-box …. which is half the reason to use this pattern to start with :) … anyway, maybe it will be addressed in later releases.

Get it while its hot : http://asp.net/downloads/3.5-extensions/

Tags: , ,
Filed under .NET | No Comments »