[Dbix-class] Difficulties with DBIx::Class inheritance

Brandon Black blblack at gmail.com
Mon Jun 26 00:52:07 CEST 2006


On 6/24/06, A. Pagaltzis <pagaltzis at gmx.de> wrote:
> * Rich <scriptyrich at yahoo.co.uk> [2006-06-24 17:15]:
> > Could anyone help me get my head around how I implement a
> > common base class for, and subclasses of, autogenerated
> > DBIx::Class classes?
> >
> > Going with a simple example:
> >
> >
> >     Foo::User    Foo::Project       <<< My sub classes
> >        |             |
> >        |             |
> >     Foo::user    Foo::project       <<< sqlt generated DBIx::Class classes
> >         \           /
> >          \         /
> >           \       /
> >            \     /
> >             \   /
> >              \ /
> >          Foo::Base                   <<< Common functionality
>
> I'm going to go out entirely on a lark and say you'll probably be
> able to get what you want quite easily if you use a different
> inheritance tree:
>
>        Foo::User    Foo::Project       <<< Subclasses
>           |\           /|
>           | \         / |
>           |  \       /  |
>    Foo::user  \     /  Foo::project    <<< sqlt generated DBIx::Class classes
>                \   /
>                 \ /
>             Foo::Base                  <<< Common functionality
>

I would tend to agree with Aristotle on the heirarchy.  But also note
that if you are playing inheritance games with
DBIx::Class::ResultSource-based classes, you'll have to deal the
issues recently docced to this list by Sebastian Willert at:

http://lists.rawmode.org/pipermail/dbix-class/2006-June/001691.html



More information about the Dbix-class mailing list