This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
Ruby on Rails MVC Web devleopment framework:
The ruby on rails framework is based upon MVC design pattern which is a Model View Controller pattern. This design principle divides the work of an application into three separate layers where the presentation to the client is handled by views, the database communication is handled by the model layer and the controller is used for communication between these two layers and handle requests from clients and users
Model (In rails known as ActiveRecord ) :
The model layer is the middle layer of the MVC design pattern. It is used for database communication and basically maintains all the relationships between Object and Database and it is also used for handling validation, association, transactions, and more between different objects.
This layer is implemented in ActiveRecord library which is the base library in rails for handling object model requests and which provides an interface and binding between the tables in a relational database and the Ruby program code that manipulates database records.View ( In Rails known as ActionView )
Views are primarily there to handle the presentation of results, data to the end-user. In rails data can be presented in different methods such as those in response to general html requests where html page is finally rendered to the clients, or in response of json or ajax requests where the responses are json objects etc.
Script based templating like other platform is used in rails and that is known as Embedded ruby based systems which generate views file that usually end up with extensions filename.html.erb where filename is usually the filename and that precedes the extension commonly used for generating html script based response.
Controller ( In Rails known as ActionController ):
Controller is the backbone for any rials applications. Through this layer all the requests that are generated by the clients and all the responses that the server generates is handled. It primarily acts a traffic controller in real world life whose basic aim is to redirect control from one place to another and who is also involved in communication with different other layers such as models and views for generating the required reponses to the clients
Pictorial Representation of MVC Framework:
A Pictorial Diagram of Ruby on Rails Framework is given here:
ADVANTAGES OF USING RUBY ON RAILS
Rails is built open ruby language which is a dynamically programming language. So the basic advantage of rails comes by the usage of this language because ruby makes life easier to do meta programming.
One of the advantages of Rails is that its an MVC framework where Rails provides all the layers for handling the views, the database communication (models) and the interaction between both of these layers through controllers. Other frameworks rely on different developmental efforts to achieve this
Another key feature is the mapping of database tables to Ruby objects known as models. Your application code and your running database already contain everything Rails needs to know so you dont have to handle the inner details.
Rails can automatically handle lower-level details without you having to tell it to do so. Hence you only write fewer lines of code to achieve a certain functionality and also faster performance in return.
Rails follows a scheme of convention over configuration. Rails' use of runtime reflection and metaprogramming eliminates much of the code that you would otherwise have to create.
The typical development cycle for testing a change to a web app has steps such as configure, compile, deploy, reset, and test. Rails has its own testing environments with power to write integration, functional and deep down unit level testing.
One of the exciting features in rails is scaffolding. With scaffolding Rails can automatically create a full set of CRUD (Create, Retrieve, Update, and Delete) operations and views on any database table. They can then customized and made in a manner that you would lke to use for your applications.
Since rails is open source there are a large number of contributions by a large set of open source developers that are very helpful such as friendly urls for generating search engine friendly urls that can attract more and more clientele for any website.
This framework also provides the mechanism of filters. They allow you to run preprocessing code before Rails executes an action and post-processing code after it completes an action. They are useful for such things as caching or authentication before calling the action, and compression or localization of the response after calling an action.
The mechanism of processing AJAX requests is handled very easily in rails. Rails has a simple, consistent model for how it implements Ajax operations. Once the browser has rendered and displayed the initial web page, different user actions cause it to display a new web page (like any traditional web app) or trigger an Ajax operation.
DISADVANTAGES OF USING RUBY ON RAILS
◦ Apart from all of the advantages that have been mentioned in the support using ruby on rails framework. There are some of the issues with this framework:
Speed (especially on Windows) -not compiled like .Net is a major. Usually the applications built using ruby on rails are not the fastest ones around.
Since its a new platform and there are no large number of programmers of ruby on rails. Sometimes for a newbie its a difficult platform for new users to cope up with and it takes a lot of time to master this framework
Since it has only been around for only a few users. The support for this framework is probably not the best ones. Unlike other mature frameworks such as like .NET there is No MSDN-like phone support for ROR.
Rails doesnt provide any sort of server controls for Rapid GUI Development
Scalability is sometimes a really important issue with this framework.
- One potential constraint that you may need to consider is that it may not fit very well in an existing 'enterprise' architecture with all kinds of rules and regulations. For example, certain big companies have policies such as using stored procedures to access databases and to use certain naming conventions for table/field names etc. Under such circumstances, Rails will begin to loose its magic since it relies on "convension over configuration" and automatically reflects on the underlying table/field structure to dynamically create Records.
Another constraint that you may want to think of is the Security. There
are well established tools/libraries/techniques in corporate environment
that have leveraged C++/Java for a long time. Ruby/Rails is just too
new and a bit immature to be able to challenge them yet. Though, will
JRuby looming on horiozon, you should be able to mix-and-match at least
A similar argument can be made for a two phase commit requirement.
Now, you have to balance all this in practice. How often do you need
aforementioned features? Most people overestimate that. On the other
hand, in a financial services environment, e.g. banking, such features
are critical requirements and cannot be compromised upon. That will
still be the turf of C++/Java/J2EE.
Ruby on Rails Framework http://www.tutorialspoint.com/ruby-on-rails/rails-framework.htm
What is Rails http://onlamp.com/onlamp/2005/10/13/what_is_rails.html