16 June 2010

0 Overview of Ruby on Rails RoR

Ruby on Rails – the Framework

Ruby on Rails is an open source web application development and persistence framework that supports agile development and sustained productivity. It is a common observation that web application development using Rails framework is at least 10 times faster compared to other frameworks.

Rails framework was extracted from working applications that were written in Ruby. This means that Rails code base was practical, proven and well tested before it took shape as a framework.

Rails framework includes everything needed to create database backed web applications according to the Model-View-Control (MVC) pattern of separation.

This pattern splits the view (also called the presentation) into "dumb" templates that are primarily responsible for inserting pre-built data in between HTML tags.

The model contains the "smart" domain objects (such as Account, Product, Person, Post) that hold all the business logic and know how to persist themselves to a database.

The controller handles the incoming requests (such as Save New Account, Update Product, Show Post) by manipulating the model and directing data to the view.

Following are the typical set of tasks that one needs to perform to build a bare bones database backed web application using Rails:

  1. Create a new Rails project using the utility script provided as part of the framework. Doing this creates a directory structure for the new project which is common across all the Rails projects.
  2. Create necessary database with associated tables. Each of these tables maps to a model class.
  3. Generate a scaffold specifying the model and controller names to the scaffolding utility. This step needs to be repeated for all the different models that are needed for the project.
    The above process generates views for CRUD (Create, Read, Update and Delete) and list actions, wired to corresponding controller classes. Data fields associated with these actions are automatically picked up from the database tables created in the previous step.
  4. A barebones application that can show the core application data with capability to add, modify, view and delete is now ready!

Over and above the barebones application created above, sophistications can be added easily. Each of these additional sophistications is also a piece of cake if we follow the conventions of Rails framework. For example, the table name associated with each model class name follows a convention that the table name will be a plural of the model class name. Such conventions over configurations make the amount of code very less, and hence make the amount of work to be done by the programmer very less, eventually resulting in increased productivity. Another principle followed in Rails paradigm is called DRY (Don’t Repeat Yourself) that aims at eliminating code redundancy.

Rails framework has the following salient features:

  • User friendly
  • Agile
  • Rapid prototyping capability
  • Built in testing capabilities
  • Easy to maintain
  • Scalable
  • On par performance with other frameworks
  • Support for Webservices
  • Support for emails
  • Support for AJAX
  • Support for development , testing and production environments


0 comments:

Feeds Comments

Please give your valuable comments.