I know that Rails uses the Single-Table Inheritance as mentioned in the wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I was wondering if there was an easy way of implementing Class Table Inheritance easily (one table per class) as defined in http://www.martinfowler.com/eaaCatalog/classTableInheritance.html. The model that I am used to is Class Table Inheritance, and for some uses it just feels more elegant to use that rather than Singe Table Inheritance. -- Posted via http://www.ruby-forum.com/.
What''s a good way to backup and restore a database and the images on the file system? Does anyone have any code to share? I have my own idea that I can write up but I don''t want to reinvent anything. On 6/5/06, JR Santos <joseph.santos@gmail.com> wrote:> I know that Rails uses the Single-Table Inheritance as mentioned in the > wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I > was wondering if there was an easy way of implementing Class Table > Inheritance easily (one table per class) as defined in > http://www.martinfowler.com/eaaCatalog/classTableInheritance.html. > > The model that I am used to is Class Table Inheritance, and for some > uses it just feels more elegant to use that rather than Singe Table > Inheritance. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
JR Santos wrote:> I know that Rails uses the Single-Table Inheritance as mentioned in the > wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I > was wondering if there was an easy way of implementing Class Table > Inheritance easily (one table per class) as defined in > http://www.martinfowler.com/eaaCatalog/classTableInheritance.html. > > The model that I am used to is Class Table Inheritance, and for some > uses it just feels more elegant to use that rather than Singe Table > Inheritance.I find SingleTable inheritance better as it has less maintainance. Having independent tables for object where only the behavior is different doesn''t make sense as databases are supposed to capture the persistent data and let your class define the behavior. It''s just too many tables to to hold each type of object. ajay -- Posted via http://www.ruby-forum.com/.