14 July 2007

Ruby on Rails (RoR)

(Sometimes known as "Rails")

As the name implies, a open-source software application whose core includes the Ruby language; incorporates other program elements to assist in the creation of Ruby-coded, database-oriented websites. It can be roughly described as a special type of CMS, except that, while a CMS is essentially a dynamic website creator, Ruby on Rails is supposed to allow a designer to substantially add website functions that the developers may not have thought of. Nearly all web applications are CRUD—reate, read, update, and delete information from a database. RoR automates this as much as possible.

The architectural principle of RoR is the model-view-controller (MVC) template, which is somewhat similar to the basic database concept itself. The MVC schemata divides the structure of the application (and the data it manages) into a model, a view, and a controller. The model can be described as a map of the domain-specific data. Put another way, the database is a body of data stored in a select location or group of locations (domain), and the model maps data to a diagram (the way a map has a fixed relation between points on the earth's surface and points on the paper).

The view component of the software is responsible for rendering the model (for navigating the data), getting updates from it, sending user commands to the controller, and fulfilling controller view selection. The controller translates user interactions with the view into work performed by the model. The view module passes user gestures to the controller, which then maps those actions to the model. The MVC schemata is used with object-oriented databases, in which the view module may need to change a lot. Another important point is that MVC standarizes much of the OO-database management system so that naming conventions are highly predictable.

Ruby on Rails uses this system to define its object classes: the base class for the model is ActiveRecord::Base, and each of the tables in the database is a subclass of objects.[*] This actually allows one to automatically generate, with a single command, a new web application with at least one view and one controller (with four methodsadd, delete, login, and logout).

Another interesting feature is that RoR does not require a separate code file for each URL; Rails uses an architecture in which the controller and a view (an ERb template in an .rhtml file) together serve a number of actions. Each action handles some of the URLs in the modeled domain. These defaults are so comprehensive, they are known as opinionated software, and naturally can generate most of the look and feel of the web application spontaneously.

Rails is a fairly recent product; it was first released in 2004 and, like GNU/Linux, can be substantially modified by the distributor. One of these will, in the future, be Apple: Rails is now a standard component of the Mac OS X operating system.

SOURCES & ADDITIONAL READING: Ruby, "What's Ruby?"; Wikipedia, Ruby on Rails and Model-View-Controller (MVC);

Developer Shed, "Web Development: Ruby on Rails";

Labels: , , , , , , ,


Post a Comment

<< Home