Comparing web frameworks on Mono

July 9, 2009

Thinking about MVC

Currently CruiseControl.NET is using its own MVC implementation. Now that there are several MVC frameworks for the .NET platform out there we were wondering if we should replace the MVC code of the dashboard with a framework that we do not have to maintain ourselves. This would also make the dashboard code a little more readable i think.

Which framework to use?

Two candidates we were talking about are the ASP.NET MVC framework released as OpenSource by Microsoft [1] and the MonoRail framework released as OpenSource by the Castle project [2]. While investigating Mono compatibility i found out that there are MonoDevelop addins for both frameworks [3] [4]. I thought i should go ahead and try both of them.

ASP.NET MVC on Mono

The ASP.NET MVC addin [3] was already listed in my addins menu and i just had to activate it. It was quite refreshing to see how easy it is to write an ASP.NET MVC application using MonoDevelop. The addin does support the creation of ASP.NET MVC projects and is creating the whole project skeleton for you. It also helps with adding more controllers and views through some context menu entries (see the screenshot). There is no support for adding models, but as far as i get it it is because there is no pattern for creating models in ASP.NET MVC and you can do pretty much whatever you like. After creating the project you can launch your app using the “Debug” button or by pressing F5. Mono’s xsp2 engine is launching your app and your browser is starting showing the start page of the application you just created. After this experience i thought ASP.NET MVC on Mono is really an option for CC.NET.

MonoDevelop with the ASP.NET MVC AddIn

MonoDevelop with the ASP.NET MVC AddIn

Castle MonoRail on Mono

Using Google i also found a MonoDevelop addin for the Castle framework [4]. Sadly it does not support creating projects. For MonoRail you have to create the project skeleton manually and also the addin doesn’t help with adding controllers, models or views. It looks like the only thing it does for now is adding support for hilighting NVelocity templates. After creating a project myself and pressing the “Debug” button the experience was pretty much the same as with ASP.NET MVC. Your browser opens showing the start page of your project and everything seems to work nicely.

MonoDevelop with the Castle AddIn

MonoDevelop with the Castle AddIn

Conclusion

Just for developing in MonoDevelop the ASP.NET MVC framework seems to be the better choice (it is contained in latest Mono!), but i think IDE support is not everything. As both frameworks are working like a charm we should decide which of the features they ship are important for us. Things that could be important are IoC framework support, support for different template engines for creating views and maybe also what types of models are supported. For ASP.NET MVC i’m not certain but MonoRail is supporting different types of engines for views and i think it does also support the Castle IoC framework stuff [5]. Coming to models you have ActiveRecord [6] in MonoRail (maybe one could also use it in ASP.NET MVC?), which is currently not very important for us as we are not using a database backend, but it is nice to see that it is supported at least. From my point of view we could use each one of them. They both work on Mono and support the important stuff we need now.

[1] http://www.asp.net/mvc/

[2] http://www.castleproject.org/monorail/

[3] http://tirania.org/blog/archive/2009/Apr-02-1.html

[4] http://code.google.com/p/monodevelop-castle/

[5] http://www.castleproject.org/container/index.html

[6] http://www.castleproject.org/activerecord/index.html

Advertisements

Working towards the release

February 19, 2009

Today i wanted to commit the patches for the Subversion source control so they can go into the 1.4.3 release. I was confused to see that the patches i did just a few days ago seemed to work only partially.  I was pretty certain they did work when i tested them the last time. After neighbours cat helped me with the debugging (meow!) i found out that there had been an exception in the Subversion source control for quite some time now and the recent changes for CCNET-748 were causing the build to fail because of that exception. After i found out what was happening it was easy to make everything work again and now the new features of the Subversion source control should work pretty well. I hope they also work for you now.  Thanks cat! Until next time…