CSC/ECE 517 Fall 2007/wiki2 1 p23

From Expertiza_Wiki
Jump to navigation Jump to search

Ruby on Rails and Apache Struts: A comparison based study

There exist several web application development frameworks in the market. A software developer faces a dilemma regarding which of these to employ to implement his application, based on criteria such as enhanced productivity, complexity, scalability, requirement satisfaction, maintenance, etc. This article aims to compare two such frameworks, Ruby on Rails and Apache Struts, from the perspective of the developer and that of the finished application.

Introduction

Web application frameworks are employed to develop dynamic web pages as well as web applications and services. Generally, web application frameworks comprise libraries compiled into a cohesive software stack. Web applications differ from static web pages in that they allow the generation of dynamic responses through database interaction.

Ruby on Rails as well as Apache Struts are based on what is known as the Model-View-Controller (MVC) architectural pattern. The concept underlying MVC is to separate the presentation layer (view) from the logic and the data model. This ensures that any changes to the user interface will not affect the business logic, and reorganization of the data model will not affect the user's view. Ruby on Rails and the Apache Struts framework are both based on the MVC Architecture.

Problem Statement

"Compare Ruby on Rails with Apache Struts. The Apache Struts framework in the Java world occupies a position similar to Ruby on Rails, except that it is not as universally used. Compare the two. Which are the advantages of each for the developer? For the finished application?"

Ruby on Rails

Ruby on Rails is a framework that facilitates the development, deployment and maintenance of web applications, written in the Ruby programming language.

Design Paradigms

Rails was designed with the underlying concept of Don't Repeat Yourself (DRY), which emphasizes that every piece of information in the system should be expressed only once. As a result, changes to applications designed with Rails will impact a lot less code than they would in other frameworks.

Another paradigm that Rails is based on is Convention over Configuration (CoC), which means that Rails has defaults for every aspect of the application being developed. Hence, following conventions can lead to application deployment with much less code than would have been written in another programming language.

Architecture

Rails is designed based on the MVC Architecture. It enforces a structure for the application where models, views and controllers are developed functionally separately, and then knit together during the execution of the application. Incoming requests are sent to a 'router', which computes where the request must be directed to, and how it must be interpreted. This directs the request to a method in the controller (an action), which performs some data manipulation or computation. The data is then rendered as a view to the user.

Active Record

Rails maps relational database tuples to objects using Active Record: tables map to classes, rows to objects, and columns to object attributes. Active Record facilitates the implementation of the primitive database operations: Create, Read, Update and Delete.

Apache Struts

Comparison and Evaluation

These web application frameworks can be compared against each other based on several criteria.

Comparison criteria

  • Complexity
  • Speed
  • Hmm?

Conclusion and scope for future work

See Also

References