Tutorialspoint(2008) states that the Model View Controller principle of Ruby on Rails MVC framework divides the work of an application into three separate but closely cooperative subsystems, which are Model (ActiveRecord ), View ( ActionView ) and Controller ( ActionController ). These three features are similar to actionscript 2.0.
Model (ActiveRecord ) of MVC
Maintains the relationship between Object and Database and handles validation, association, transactions, and more.
This subsystem is implemented in ActiveRecord library which provides an interface and binding between the tables in a relational database and the Ruby program code that manipulates database records. Ruby method names are automatically generated from the field names of database tables, and so on.
Actionscript 2.0 is as same as MVC Ruby that also can maintains the relationship between Object and Database, for example ActionScript 2.0 code to link the object from results to the dataProvider of the dataset, as shown in the following OO code;
myObject : Object = new Object();
myObject.result = function() : Void
{
my_ds.dataProvider = my_ws.results;
}
my_ws.addEventListener(“result”, employeeObject);
View ( ActionView ) of MVC
A presentation of data in a particular format, triggered by a controller's decision to present the data. They are script based templating systems like JSP, ASP, PHP and very easy to integrate with AJAX technology.
This subsystem is implemented in ActionView library which is an Embedded Ruby (ERb) based system for defining presentation templates for data presentation. Every Web connection to a Rails application results in the displaying of a view.
Actionscript 2.0 also have a templating feature, as shown in the following figure which is from http://ntt.cc/wp-content/uploads/2009/01/clip-image001-thumb3.jpg

Controller ( ActionController ) of MVC:
The facility within the application that directs traffic, on the one hand querying the models for specific data, and on the other hand organizing that data (searching, sorting, massaging it) into a form that fits the needs of a given view.
This subsystem is implemented in ActionController which is a data broker sitting between ActiveRecord (the database interface) and ActionView (the presentation engine).
Adobepress (2009) states that ActionScript objects provide a means of moving graphic elements dynamically, building applications, organizing data, and more. You accomplish these tasks by using or setting object property values and invoking object methods.
Referances:
Tutorialspoint(2008). “Ruby on Rails Framework” . Received 24th March, 2009 from URL - http://www.tutorialspoint.com/ruby-on-rails/rails-framework.htm
Adobepress (2009). “Introducing ActionScript Objects” . Received 24th March, 2009 from URL - http://www.adobepress.com/articles/article.asp?p=31465
沒有留言:
發佈留言