Architectural design of Ruby on Rails framework

As we all know, Ruby on Rails is an open source web framework, which is written in Ruby programming language. Yukishiro Matzumoto has designed this language in 1995 in order to make the development process faster. It is a dynamically typed, fully object-oriented, general-purpose scripting language. RoR was basically created as a response to heavy web frameworks such as J2EE and .Net for the database-backed web application development. There are many basic web development tasks inbuilt in RoR framework that works out-of-the-box and increases the productivity. Let’s have a look at the basic components of Rails architecture.

Some standout features of Ruby on Rails framework architecture are as following:

  • It is an Open-source server side scripting language
  • It is featured with Model-View-Control architecture
  • It has Representational State Transfer (REST) for web services (its functionality and state are divided into distributed resources)
  • It uses human-readable data serialization format YAML machine

All these features are further distributed in several Rails’ components. Few of those Rails’ modules are described below:

Action Mailer

This module is wrapped around the Action Controller. It is responsible for providing the e-mail services. It manages the incoming e-mails and lets you create new emails. This module can handle simple text or rich-format emails along with some common tasks like sending forgotten passwords, welcome messages and any other written communication needs.

Action Pack

Action Pack module provides the controller and view layers of the MVC (Model, View, Controller) pattern. It captures the user’s request from the browser and map the request to actions. It is further divided into 3-sub modules.

Action Dispatch – It routes the web browser requests

Action Controller – It makes the routing to request’s corresponding controller after action dispatch processed the request. It contains the actions to control model and views.

Action View – Action view renders the presentation of the web page requested. It provides master layouts, templates lookups and view helpers. There are three templates in Rails, which are rhtml, rxml and rjs.

Active Model

Active module creates an interface between the Action Pack and the Active Record modules. It can also be used outside of Rails framework to Object-relational mapping (ORM) functionality.

Active Record

Active record is used to manage data in databases through objects. This module connects Model layers to the database tables with its representation in ruby classes. It provides tools to implement Creating, Reading, Updating and Deleting records functionality with zero-configuration.

Active Resource

Active Resource module connects the RESTful (REST – Representational State Transfer) web services and business objectives. It follows the same principal as Active Records that reduces the amount of code needed to map any resources.

Active Support

It is a collection of classes and Ruby libraries extensions, which is useful in the development of Ruby on Rails.

Railties

Railties is core Rails code that built new rail application. It handles all the bootstrapping process and provide rail’s code generator. It is responsible for connecting all the above modules together. Rails also provide us built-in testing framework that generates stubs when code id is generated. It provides unit testing, test fixtures and functional testing for views and controls.

Ruby on Rails has gained lots of support from the software development community over the years. That is the reason why RoR provides the robust architecture. This Ruby on Rails architecture meets most of its intended goals. Web developers have promptly accepted this healthy framework over the years.

Recent Articles

Browse some of our latest articles...

Prev
Next