Why Put Your Organization on Rails?
The software development industry is often driven by fads and hype. People are always talking about the new programming language, software engineering methodology, framework, or tool that will increase efficiency, lower costs, speed up development, and improve quality. The most recent fad in Web development is Ruby on Rails, a framework for building Web applications that has been the subject of many wild claims by enthusiasts. As a manager, you have to assess whether Ruby on Rails, like any other new technology, lives up to the hype.
Rails is an open-source Web application framework that's notable for its highly structured approach to building Web applications — not only does it include a lot of the functionality that programmers usually have to build themselves when writing Web applications, but it also provides a structure for everything from how files are organized to how database tables are named. Rails rewards programmers for utilizing this structure by enabling them to get things done without writing much code.
A developer who knows Ruby on Rails will understand how just about any Rails application is structured right from the outset. When you outsource development of a Rails application, moving the application in house for ongoing maintenance is straightforward, as is adding a new developer to your team. At a source code level, Rails applications are all quite similar, even if the functionality is completely different. The structured approach taken by Rails greatly reduces the risk that a developer will wander off and build something that can't be understood, much less maintained.
Ruby on Rails is new — version 1.0 was released in December, 2005, 15 months after the first public release. Ruby, the scripting language used to build Rails, was originally released in 1995, around the same time as Java. The biggest reason that Rails has seen such rapid success is that it builds on the best parts of the Web application frameworks that preceded it. The creators of Ruby on Rails adopted the best practices of the Java and PHP communities and baked them into a new framework.
The Rails Philosophy
In building Web applications, two important factors are speed of development and maintainability after release. Ruby on Rails is strong in these areas because of its philosophical approach, which is based based on two principles: "Don't repeat yourself" and "Convention over configuration."
"Don't repeat yourself" is straightforward. Code in a Rails application is organized to make it easy for developers to build their application so that each piece of functionality only exists in one place, where it can be reused throughout the application. In an application that adheres to the Rails philosophy, you never need to trawl through dozens of pages changing the footer on every one, nor do you need to check in multiple places that you've made the zip code required when a user enters an address.
The idea behind "Convention over configuration" is that Rails makes many assumptions about how an application should be organized, what things should be named, and how databases should be laid out. Not coincidentally, coming up with these kinds of conventions is generally one of the toughest problems in application development. Most organizations have their own set of conventions, but Rails goes a step further and suggests a single convention that applies to all Rails applications. The primary advantage here is that developers are liberated from the configuration files that most frameworks require. As long as you adhere to the Rails conventions, many things that you would ordinarily have to write code for just work. Convention over configuration is responsible for most of the efficiency advantages Rails provides over other platforms.
The Components of Rails
The creators of Rails chose the Ruby programming language because it offered the very strong object-oriented capabilities of languages like Java with the flexibility of scripting languages like Perl and PHP. Developers have tried to emulate some of the best features of Rails in other languages, but many of the best features of Rails depend strongly on the capabilities that Ruby offers.
Ruby on Rails is a collection of libraries, including a templating library which enables you to mix code that will be executed on the server with regular HTML markup to make it easy to build dynamic Web applications. In the world of Ruby on Rails, the intent is that these templates will only be used to present dynamic data. The business logic resides elsewhere. For example, there's a layout feature that enables programmers to wrap the content on their pages in a header and footer (and possibly other common elements as well) without including any code at all in the individual views, thus eliminating even the common header and footer include statements that are repeated on every page in most applications.
Ruby on Rails provides a Model-View-Controller framework that splits up an application to provide structure, flexibility, and reuse. The controller accepts incoming requests from the browser and then routes them to the proper part of the application. After processing, the controller passes the results to the view layer for presentation. Business logic resides in the Model layer, which takes care of database interaction as well as processes like calculating shipping costs and sales tax, or finding search results, or validating user input. The View layer is used to present the results. Use of MVC frameworks in Web applications has been popular with Java developers since 1999.
The last component of Rails is a database persistence framework that provides a bridge between a relational database like MySQL, MS SQL, or Oracle and an application. It enables you to treat data stored in a relational database like regular objects within your application.
The Other Side of the Hype
Ruby on Rails has a lot going for it, but there are some things to look out for as well before taking the leap. First, because Rails is still new, the pool of Ruby on Rails experts is not very large, even though Ruby on Rails is not difficult to learn, Before making a big commitment to Ruby on Rails, make sure that you can find the experts you need, whether through staffing or outsourcing.
Deployment challenges are another mark of the relative immaturity of Ruby on Rails. Figuring out how and where to deploy your applications is not as easy as it is for other platforms. Finding a Web host where you can deploy your Rails application and getting everything up and running can be painful, especially when compared to platforms like PHP and ASP.NET. If you're deploying the application internally, chances are your systems administrator is going to have to do some research to get your Ruby on Rails application running on your own server. The deployment picture for Ruby on Rails continues to improve, but right now dealing with deployment can be a complex issue.
Because Ruby on Rails is still changing rapidly, it may be best for some organizations to delay adoption. The core Rails libraries are still being updated frequently, as are many of the supplemental libraries that many developers use. Keeping up with the state of the art in the Rails world is a big job, and not all development teams are suited to take on that job.
The Bottom Line
Should you consider adopting Ruby on Rails for your next Web application project? The ideal trial project for Ruby on Rails is a new application that won't be accessing a legacy database, hosted on a server running Linux or some other Unix variation. Ruby on Rails works fine on Windows, but is still better suited to Unix-based environments. Ideally the application will stand on its own rather than being a piece of a larger application. Ruby on Rails is most powerful in terms of streamlining database interactions, so an application where you are manipulating information in a database will enable you to reap the greatest rewards from Rails.
Rails enables developers to get more done in less time, but for each project you have to assess whether that argument is applicable. A lot depends on the project requirements, and the expertise and enthusiasm of the development team. If your developers are clamoring to try out Ruby on Rails, then it's probably worth a shot. Very few new platforms will be adopted successfully if they are imposed from the top down.
Even if Rails isn't the right fit for you right now, it very well may be in the next year or two, as the platform continues to mature.
Application Development
- Why Put Your Organization on Rails?
- Go with the Flow - the Workflow, That is...Picture this -- a physician participating in a clinical study is recording a patient's vital statistics and reaction to a trial treatment. The physician picks up a pen and scribbles this information onto a paper chart, which will later be transcribed into a computer database that may or may not be connected to the organization sponsoring the study. You're probably thinking this is a scene from 1980, which would be correct -- but what you may not guess, is that it is also a scene from the 21st century!
- Is There Value in Open Source?
- Debugging Web Applications
- Finding the Right Search Engine