in reply to Inheritance, Class::DBI and POOP
I don't know much about Class::DBI, but I have spent some time over the OO <-> relational DBMS questions.
The three classical solutions for subclassing are:
In the first and second case, a query over the common attributes will probably map to a single QUERY statement. In the third case, you have to repeat the query for all subclasses.
In case 1/2, you will probably have to deal with casting issues, since after getting the common attributes you should determine what class they belong to and retrieve the remaining attributes. This can be transparent and often avoid one more query if the mapping layer implements lazy attributes. In case 3, you would not face this problem, because each query would only deal with one class. Best regards
|
|---|