Here are the factors that go into considering these two "Web Stacks" as viable open source platforms:
- Does the platform support multiple databases in such a way that does not require a major refactoring for each database supported?
- Does the platform have native support for a multilingual user interface?
- Does the platform support a modular view solution that can support various screen sizes and capabilities?
- Does the platform allow the business logic layer to be decoupled and reused in other non-web application capacity?
- Is there a large development community that will be able to look at the code base to add to the project at a future date?
- Is the platform significantly cheaper to develop and deploy than the competition?
- Is the platform stable over a long period of time? (do security patches to the OS threaten the features of the deployment?)
Last week, I began implementing ScrumTime 1.0 in ASP.NET MVC 4. The source may be found here. This week I began implementing ScrumTime 1.0 with Grails 2.0. The source may be found here.
Here are the answers to the questions above:
Grails Answers
- Yes. Grails uses hibernate under the covers. Therefore, Grails has support for all major database vendors and the JDBC drivers are widely available.
- Yes. Grails has a large focus on multilingual user interfaces with the inclusion of the i18n folder with each newly created project. This folder holds the resource files that contains the different strings for the different languages supported.
- Yes. Grails supports a concept of "layouts" and "templates" that allows a developer to create and reuse view components.
- Yes. Grails compiles down to a set of Java classes that may be referenced from any other Java application running on the same VM.
- No. Grails is built on Groovy which is a dynamic language that compiles into byte-code that runs on the Java virtual machine. Unfortunately, the number of Groovy developers in the world are far outnumbered by the number of C, C++, VB, C#, and Java developers.
- Yes. Grails is much cheaper to develop and deploy. It is conceivable that the cost of development and deployment is free since it can be done with open source tools and platforms.
- Yes. Since Grails runs in a JVM, there is little to no relationship between the JVM and the operating system.
ASP.NET MVC 4 Answers
- Yes, well sort of. MVC 4 supports the latest Entity Framework 4.1 that includes something known as "Code First". Code First support all Microsoft databases, Oracle, MySQL, and supposedly any database that has an ADO.NET provider. Another option is to use NHibernate instead of EF at all. NHibernate supports all of the major database vendors.
- Yes. MVC 4, like all .NET applications, may contain "resource files." There are several options for making use of the resource strings, but the most clear option is to use a reference in the model's constraint annotations.
- Yes. MVC 4 allows developers to define "layouts" and "partial views" that follow the view reuse best practices of other web frameworks like Grails and Ruby on Rails.
- Yes. The most straightforward way to implement a reusable Business Logic Layer in MVC 4 is to implement the BLL in a separate .NET DLL. Then the DLL may be used by the MVC 4 web application.
- Yes. MVC 4 may be built on .NET VB or .NET C#. The usage of C# seems to be growing versus VB according to indeed.com job trends. Therefore, in the comparison with Grails, I have focused on MVC 4 .NET C#. The C# open source community is very large. It is not quite the size of Java or C/C++, but it is global.
- No. The cost of development is basically free if Visual Studio 2011 Express is considered sufficient (I have been using Visual Studio Professional). The cost of deployment is likely more than zero...it depends on the amount of data that is required to be stored and the number of users that would be connecting.
- No. The .NET framework is affected by system updates to the Windows operating system. While it is possible to separate the .NET specific updates from the rest of the operating system updates, that is a hassle. Also, due to the success of the .NET framework for Microsoft over past ten years, it has become more intertwined with the operating system. As a result, it is not always clear where .NET begins and and the operating system ends. Therefore, at the very least, ASP.NET MVC 4 requires Windows operating system knowledge and research for each patch deployment...that is an ongoing cost that is arguably greater than that of maintaining a JVM.
Based on the criteria above, the ASP.NET MVC 4 "Web Stack" seems to be the prudent choice because of the large development community. However, the development cost and deployment cost is not as positive. By
*Update (04/23/2012) - ASP.NET MVC 4 is the first to be heavily researched. The source may be found here on GitHub.
*Update (05/14/2012) - Grails 2.0 heavy research begins. The source may be found here on GitHub.