| Περίληψη: |
This article presents information about Ruby on Rails, an interesting portable object-oriented web scripting language. Ruby on Rails is a new version of old Ruby, a portable object-oriented desktop scripting language. It embeds the Ruby programming language in HTML in much the same manner as PHP and ASP. Rails uses a model, view and controller pattern, with an object-relational mapping (ORM) layer for accessing databases. The ORM is called Active Record, and it connects business objects and database tables to create a persistable domain model where logic and data is presented in one wrapping. Active Record maps Ruby class names to database table names using a simple set of default production rules. A class called Order maps to a table named orders. A few irregular plurals are included, so a class named Child maps to a table named children. If the default rules don't work for example, if user has an oddly-named legacy table he wants to map to a helpfully-named class then he can override the mapping. Active Record does a good job of wrapping access to tables and fields with strongly-typed classes and variables in MySQL, PostgreSQL, SQLite, SQL Server, DB2, and Oracle databases. |