Article

Ruby and Ruby on Rails (RoR)

A humble beginning

Ruby is a scripted, object oriented programming language released in the mid 1990's. Some of the strengths of Ruby include easy to use text processing through robust string and regular expression classes, automatic memory management, and powerful run time object and class manipulation. Ruby prides itself on putting the developers first and strives to make their lives easier. It shares a lot of features and ideas with more mature languages like Python and PHP and lends itself towards server side scripting. The language itself enjoyed a reasonable following but wasn't widely known until recently when the Rails application framework took Ruby from "just another scripting language" to celebrity class stardom almost overnight.

 

Then along comes Rails

Rails is a very young web framework built in Ruby. It was released to the public in July, 2004 and has become a wildly popular way to create dynamic web systems with back end database support.

The beauty of the Rails framework is the way it takes advantage of the run time object and class manipulation power of Ruby to automatically analyze database tables and build Ruby objects that can be used by the developer. In most other languages and frameworks, the process of hooking the database to software constructs the developer can use is often laborious, error prone, and the code is in constant need of maintenance as the system and underlying database grow in size. Due to Ruby's ability to create methods, object, and classes dynamically at runtime, the headache of interfacing with database tables all but disappear.

Another strength of the Rails framework is its implementation of the Model/View/Controller architecture, or MVC for short. The MVC design philosophy separates the data (known as the Model) from the way the data moves and changes (the Control) from the way the data is displayed to the user (the View). This separation allows complex systems to be modeled as data without the need to worry about how that data will be displayed and manipulated by a user. Rails then takes the data definition, creates the appropriate database tables and objects to interact with them, and also builds generic controllers and views so a developer can immediately begin to customize the application to the problem at hand. The speed of moving from a data definition to a working prototype is astounding and is a large part of reason Ruby on Rails is quickly becoming the environment of choice for database driven web systems.

With large, legacy systems already written in another technology like PHP or one of the many Java systems, the low level database to object mapping is already done and it generally makes financial sense to extend the system in it's current technology rather than re-writing it in Rails. On new development projects however, we look heavily at building them with Ruby on Rails due to the significant savings in development time and cost. If you would like to find out more about how a Ruby on Rails implementation might work for your next project, contact us. Your initial consultation with a senior developer is always free.