« J2EE vendors moving up the stack -- without Java ? | Main | XQuery not likely in .NET 2.0, strange to say the least. »

May 2, 2005

Ruby on Rails : Impressive, will surely shake up web development.

After using Ruby and Rails, believe me when I tell you, it has compelling reasons to be considered for your next web application and the capabilities to shake up web development as a whole.

[Entry continues to the left and below ad ]

While .NET and Java/J2EE have the biggest mind share among development platforms, in part due to their corporate marketing power and established business networks, to date few platforms have provided compelling reasons to learn them if you are a .NET or Java/J2EE practicioner.

Even though a series of platforms have remained vibrant, Perl among the early leaders and PHP along with Python -- strong communities, commercial backers and all -- they still seem to be lacking the right features, tools or libraries needed to get them to compete head-to-head with the main contenders in creating web enabled apps.

Don't get me wrong, I have seen some pretty impressive applications written in Perl, PHP and Python, but try finding hard evidence to support the fact that these platforms are easier, faster or more powerful to develop web applications than Java/J2EE and .NET, and you will surely face an uphill battle -- in all fairness, Perl, PHP and Python gurus will surely take the opposing view, but that's another story.

PHP introduced a true object model only until its 5.0 version -- late 2004 -- which would surely be seen as a step back for anyone working with Java since this is a cornerstone to the language. Python might be a powerful scripting language with a comprehensive application server like Zope, and Perl a swiss knife as a programming language, but they clearly lack the robust libraries to accelerate the creation of applications at the rate they are expected in todays market.

Enter Ruby and Rails.

While Ruby the language has powerful idioms similar to Perl and Python -- its own creator Y. Matsumoto states that Ruby's roots are based on these two languages -- it is the Rails framework that shines for creating web based applications.

Ruby on Rails takes a very simplistic yet powerful approach rooted in common software patterns that ease system scalability -- in Rail's case -- two patterns which are paramount to web development : MVC ("Model View Controller") and Data Access Object/Relational Mapping.

Although patterns are nothing new to web development platforms, they are something that needs to be addressed throughout the development cycle, a process that can be time consuming and often painful. Ruby on Rails makes thinking in patterns an afterthought, since the use of patterns is inherent in your coding.

Java/J2EE users will surely be familiar with the MVC ("Model View Controller") pattern, which can be enforced in your application through the use of frameworks like Struts or Webwork, a process which takes a considerable amount of time to apply -- in Struts , think Action classes for every other request and the corresponding tinkering with XML files -- and although newer standards like JSF aim to take the pain out of this process, they still seem to fall short at least compared to Ruby on Rails. .NET in the MVC realm makes use of Web-Controls which represent a compelling solution ( competing to Java-JSF ), but in the capabilities of a central controller, there seems to be no established framework other than creating your own "code-behind" custom made controller.

With Ruby on Rails, you kick off development with a controller and your applications grow from there. At its most basic level, the creation of a controller automatically generates four standard views and operations ( Create, Edit, Update, Delete ) that directly plug in to your database schema. Yes, thats HTML, business logic and SQL code in one step!.

This Ruby on Rails "magic" is achieved extracting your data as it's represented in your data model, and propagating it straight out to the corresponding views. Which takes us on to the O/R mapping capabilites built into Rails.

If you have followed J2EE development for a while you will realize it has taken : Three distinct EJB versions, influence from vendors like Top-Link, and open source developments like Hibernate and Spring, for O/R mapping to finally make its formal debut in J2EE standards -- as EJB 3.0 -- which is still in its infancy. Ruby on Rails goes to great lenghts to provide O/R mapping with its standard distribution, and does so in excellent fashion.

Obviously this straightforward one step functionality -- for creating HTML, business logic and SQL in one step -- has its tradeoffs, everything has to follow a common naming convention; when dealing for example with a Motorcycle object, everthing from the view to the database table has to be named in the same fashion.

But even then, once you start drilling down into the generated Rails code, you will observe very straightforward syntax -- due in great part to Ruby -- that is easily customizable and directly in sync with software design patterns.

And while you obviously wont get advanced enterprise features like two phase commits out of the box from Rails, if you will be building an application from scratch where you have the ability to define your own data model, even though Rails is still in its infancy -- 0.13 version -- it has enough features to speed up your development time, making it a strong contender for developing web applications.

[Comments below ad ]

Posted by Daniel at May 2, 2005 10:04 PM


Comments


Post a comment




Remember Me?

(you may use HTML tags for style)

Track back Pings

Track Back URL for this entry:
http://www.webforefront.com/mtblog/mt-tb.cgi/5.