archive for November, 2007

Nov/07 27 7:50 pm

models

rails, technical

no comments


Rails’ design provides for a complete implementation of the Model-View-Controller (MVC) pattern. The model element in particular is implemented as a self-contained layer responsible for all interactions with the data storage sub system. As such the model offers the logically correct place to implement all business rules related to the correct handling of data throughout the application.

A well developed and tested model gives a great comfort and luxury that guarantees that whatever view-controller is put over the top, or how it is implemented, the integrity of the database with its respect for all business rules is complete and guaranteed.

more »

Nov/07 3 4:52 pm

migrations

rails, technical

no comments


Ruby on Rails migrations allows the complete definition of an Object Relationship Mapping in just one place. Using a more traditional approach of Java and Hibernate would require DDL to make the database table changes, possibly SQL to populate default values, XML mapping files and finally a Java class complete with getter and setter methods.

Rails achieves all of this in just one migration file. Each migration contains a couple of methods - one to move up to this version of the database model, and one to move down. Typically these might respectively contain code to create a new table and drop it.

more »

previously

archives

categories

search