Thursday 15 April 2010

Perl with Catalyst and DBIx::Class - How to load a sets of classes in an inheritance tree? -


I have to make use of this type of ARRA as a base class vehicle and most of my system. With subtypes such as cars, airplanes etc., when a method is called such that one can answer a car incorrectly, while an airplane will respond correctly.

I am planning to use a single DB table with other suggestions) with a subtype column which shows the actual subclass type and zero values ​​for the columns used by other colon subclasses. How can I stop the construction of vehicle classes in the DB query or can I (subclassic type) make suitable subclasses? (If this question is not clear then I will try to clarify on a better Saturday night (about 28 hours from now).

What you are seeing is called in DBiix :: class. In Railway / Active Record, they are called single table inheritance (STI).

The page I have linked to He describes how to override the flowering pattern so that you can see the type of vehicle of your line Minister can investigate, and then Riwalt it is desired sub-class.

No comments:

Post a Comment