[CDBI] State of the DBIx::Class Class::DBI compatibility layer
"Victor Churchill" <[email protected]> Thu, 14 Feb 2008 10:30:46 +0000
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
On 14/02/2008, Michael G Schwern <[email protected]> wrote: > Victor Churchill wrote: > > On 14/02/2008, Michael G Schwern <[email protected]> wrote: > > > > I was really excited to see this post, until this bit.. > > > >> ... And since most CDBI projects are one file, one class, one > >> table I don't believe it to be pressing. > > > > Is that serious? "One file, one class, one table?" I am using a > > "fairly complex" data model which involves a lot of navigation and, > > coming from a starting point of pure DBI+DBD, enjoyed the opportunity > > given me by CDBI to say $thisobj->{thisAttr}->{thatAttr}. > > > Please don't say that. Say $thisobj->thisAttr->thatAttr. I tore my hair out > emulating $obj->{column} in CDBICompat because the code base I'm working on > uses CDBI objects like hashes. Thank you for the tip. I had not realised this was problematic. > > > > > And then > > was daunted by the prospect of migrating to DBIxC so this > > compatibility development looked like a Great Thing. So I am > > concerned... > > > I think we have another misinterpretation. > > It's one CDBI class PER file. You can certainly use multiple classes. > > Let me make it clear. > > Currently, in CDBICompat, if you declare a relationship to another class the > foreign class either has to A) already be declared or B) has to be in a file > that can be required. > ... OK, I get that. Although all my class packages are declared in one file I don't see that as a Big Problem. Thank you for the clarification!