Why Trails is better than Rails
I haven't used much of the new "Rails"type development kits yet. However, if I have to choose amongst them, I would be choosing Trails.
The main problem with Grails (and Rails) is you are adding a new language to the mix. If all you have are highly skilled developers and not planning to do Global Resourcing then that's all cool. However, if you are building an application with a lot of use cases, its best to rely on as little changes to the development environment as possible. It is better to move your top developers off to new customers rather than repeating drudgery with each use case (you get cheaper GR resources for that).
The problems with Ruby on Rails ...
I've seen presentations and demonstrations of Rails and for the most part it is a great sell for those who are keen enough to learn new tools. Having a smaller LoC metric is good and all, but just because you can reduce something into a single line does not imply that it is generally readable.
I've done many shell and Perl one liners when I need to get things done but it does not mean I would really want to subject anyone to what I've written.Although I would be sold and would probably use Rails if I needed to get something out quickly and don't expect people to manage what I write. That hasn't happened for a while, most of the applications I tend to build is part of a large team and not a solo flight. It may change sooner than later because they have relatively good Ruby IDE support now. What critical things haven't I seen with RoR (and why they are important).
- XA transaction support. I need to be a bit more specific with this one, as most people think that XA only involves databases. XA can support different resource types such as message queues and enterprise connectors. For the most part, in order to communicate with some legacy systems, a JMS type system may be needed. The message transport tends to be part of a larger transaction which may involve database activity as well.
- Attribute oriented web page development (like Tapestry). The only way that I have seen HTML customization done in the demonstrations I've seen are through RHTML. RHTML is basically HTML with Ruby code (shades of model-1 JSPs and old ASP pages). RHTML, JSP, ASP or ASP.Net pages are usually not viewable by the browser. I alluded to when I talked about my ideal web project. Although I hear there is an add-on for this.
- I18n support. Being in Canada we have two official languages English and French. So if you have to develop applications for the government or companies that deal with Quebec, you bet i18n support is important. Although I hear there is an add on for this too.
- Single sign-on. This is more the JAAS thing. If you've been in the industry long enough, you would have heard "How many times must we do the logon use case?" quite often. Although I have an extenstion to that which is "How many times must we do the user management use case?" Personally having to do that again isn't my idea of fun, and I'd rather delegate that to a product like Tivoli Identity Manager which I just get someone to customize the screens and leave all the backend user management stuff to the product. If you have a large enough project, you would probably save more money buying the product rather than waiting for it to be reimplemented again for your application.
- Database migration. From what I saw with Rails, updates to the database tables are done manually by the Ruby developer. This would be quite a chore if there is a large number of table updates that need to be done. Hibernate provides Java developers with "schema-update" which generates the SQL needed to migrate existing database tables as needed (though you should still get your DBA to review it).
- Batch file/ant based application generation. After using Maven for a while, I haven't found a better way of structuring your source files than they did. It may be overkill, but at least it works well (with the exception of web content). An older version of Trails did this as well, thankfully they outgrew that and moved to Maven.
- Groovy Server Pages (GSP) It looks a lot like JSP files, which I would avoid because it cannot be sent back to the web development team once the Java guys put in all their tags and what not.
- Groovy Yet another programming language.
- Batch file to create new domain object. Rather than just creating a new class.
- Ant based build targets. Rather than leveraging more standard targets we have a new set of targets to deal with. This could easily be fixed by moving the development to Maven.
- I have to enter the domain class twice? Not sure why.
- Maven integration. This means dependency management, builds and project layouts are more consistent. You also get the standard site reports as you need without having to deal with a lot of low level Ant.
- A smaller code base. Because it seems to delegate a lot of its work to other opensource packages like Tapestry and Spring rather than reinventing the wheel.
- Tapestry. So we can utilize web developers with their Dreamweaver or whatever other tool more effectively rather than forcing them to use a JSP editor which may not offer them enough artistic flexibility.
- Hibernate. So we get "schema-update"
- JEE based. So we get i18n and XA out of the box rather than an afterthought.
- Not too many users. I think a good indication of this is the activity on the Trails IRC channel. I am usually the only one there when I go on.
- Their web site does not render correctly in Internet Explorer. I normally use Firefox, but there are still a number of people that are using Internet Explorer. Having their side navigation going all the way down to the bottom of the page does not look very professional.
- No update on their website since September 7, 2006
- They use Maven, but their website seems to be hand coded HTML. Rather than using something like a Mavenized report. Yes it may look more plain, but at least it is consistent. It took me a bit to figure out what the subversion URL is.
- No hot code replace. Not really possible you need to regenerate and compile every time as well. This would make things go slower and slower as your application grows.
- Seems to be only one maintainer right now. Since I started Trails again, which is just a few weeks ago, it seems that only one person is actually maintaining the framework now.
- Still in SNAPSHOT. There is no 1.0 release of Trails yet. Right now all I've been working on is the SNAPSHOT version. Although the SNAPSHOT seems stable enough. They should make a roadmap they can say it is ready and people can plan to use it.
- An updated presentation. Trails used to have a 12 minute presentation that shows a many to many relationship. Someone needs to update this presentation. Maybe I'll do that myself if I have to present Trails to my peers.

8 comments:
To address some of your points about Grails:
* Batch file/ant based application generation.
Not everybody is a Maven believer, many cannot stand it. It is one of those things that has divided the community, you either love it or hate it. I hate it.
* Groovy Server Pages (GSP)
You're right it is similar to JSP, but we have custom tags, and there are no scriptlets involved, in fact Grails is being used to build many sites that involve design teams (see http://www.tropicana.co.uk)
* Groovy
Yet another programming language.
Groovy should be relatively trivial for a Java person to pick up. It can be written with almost the same syntax as Java.
* Batch file to create new domain object.
This is optional to help you get going. You can also "just create a domain class"
* Ant based build targets.
Havn't you already mentioned Maven? This seems to be repitition. XML-based build system, whether Ant or Maven, or yesterdays news. If your build is complex you're stuffed in XML hell. Grails' build is written in in the Groovy Ant wrapper Gant.
* I have to enter the domain class twice?
Not sure what you mean here
On a final point Rails and Grails cannot really be compared to Trails. Trails does CRUD and that is it. Everything else you're stuck with Tapestry, if thats ok with you then fine, but it won't give you any productivity gain.
In Rails/Grails scaffolding is seen as a learning tool for the framework, not the essence of the framework like in Trails. I recommend you try both Grails and Rails before writing an uninformed post like the above which doesn't really help anyone trying to make an informed decision. Oh, but wait you said you don't like learning new things... oh well..
I am not a 100% Maven believer (it has its warts), but I find the Ant/Batch alternative is a worse solution especially if you are working in a more asset oriented environment where you would want to foster reuse more often.
Almost is not same. A competent Java developer may pick it up. However, you can't always guarantee you'd get competent people.
The entering of the Domain class name seems to be specified when: 1) create the domain class. 2) when you are building some control classes for the domain class.
I am not sure about how Tropicana does it. But most JSP based implementations I have seen involve web designers doing their work until they get sign off. Once sign off has been acheived then tags get put in by the Java developers.
This approach causes problems when the customer decides that they want some changes to the HTML (or have unforeseen scenarios like large amount of text) that was already signed off. It gets hard to retrofit new HTML unless you have someone with both HTML and JSP skills or the change is simple.
And before you make any derogatory comments, please indicate where I specified that I do not like to learn new things.
That only occurs in JSP when you use scriptlets, if you use good separation of concerns with no scriptlets and only tags then you don't have the problem. Designers can happily import a JSP with custom tags into dreamweaver and edit it.
As far as competencies go, I recommend you try Grails with your team, I am convinced they would find it much easier than Tapestry which is infamous for its complexity.
And I'm glad you're keen to learn things, maybe next time we'll get a more informed post ;-)
This post is odd, and strangely wrong about a few big things wrt Rails. I actually wonder if you've ever used Rails. Rails lacks Database migrations? I don't follow this at all?
Are you trying to say, "Trails is better than Rails because I haven't bothered to use Rails; therefore, I can't really make a valid comparison, but I'll write a blog entry anyway."?
Hi Archimedes, I'm the "one person" maintaining the code (actually we are 3 semi active developers right now).
We are working to make the 1.0 release.
Please join the mailing lists, I promise I will hang out on the IRC channel.
I promise I will change the site too.
If you want to check out the new site, checkout Trails from the svn repo and do a : "mvn site:site"
Let me know what you think.
Yup, I noticed :) But it is still better that zero developers I guess.
I don't have any projects that use Trails right now. I am usually on Curam projects right now. However, I do recommend it to other people more than the others I have seen if they are keen on trying something out. Well its either that or Naked Objects Framework.
Good luck with it. I still think it has the most potential of all I have seen. At least until Naked Objects Framework gets a Maven archetype as well :)
Granted, you mention that your exposure to rails is limited, but being the case, you should probably not engage in discussing what it can/can't do. In fact, Rails does quite a few things that you apparently think it can't.
For one, "one-liners" in Rails doesn't imply a mash of code compressed onto a single line as we are apt to see in PHP scripts and such. Rails inherits Ruby's minimalized language. You can do one-liners because, pure and simple, it generally doesn't take anything more to accomplish what you need.
Second, and related to the first, Rails is extremely manageable because again Ruby is a self-documenting language. You can pretty much just read the code and it sounds like English. In particular, one of Rails reasons for existence is to have a way of developing web apps so that anyone at any point can come in and pick up where the last person left off. If you know Rails, in theory, you should be able to instantly work with any Rails application. That's manageability.
Third, rhtml is not another markup language, as you make it sound. It's simply a file type. Just as a file of type php indicates to the server that it should be processed through the PHP interpreter first, rhtml indicates that Ruby should interpret the document before it is handed off to the user's browser. Being viewable to browsers is no more of an issue than a PHP page being 'visible to browsers.' The user only gets the processed html document.
Fourth, Rails has beautiful database migration support with versioning. The Rails development process itself dictates this since you develop in a development database and then migrate to a production database when you launch.
I found it a little ironic/sad that you seemingly took so much time in developing this article (it's constructed very well), yet devoted very little effort to fact-checking.
Archimedes - well written article.
Chris - What Archimedes said was "RHTML, JSP, ASP or ASP.Net pages are usually not viewable by the browser." What he meant was when these pages are viewed directly and not when they are delivered by Web server. This is important when these pages are handed over to web designers and they cannot view these pages correctly through their web designer tools/browsers. Only way to view these pages correctly is to run the application or view them through IDEs which support these markups.
Post a Comment