Brandon Black wrote:
> On 5/8/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote:
>> > For the sake of me not forgetting this later...
>> > CAG would use 'inherited' as the storage for component classes...
>> >
>> > This leads me to believe that get/set_inherited are wrong when used in
>> > DBIC because CAG uses standard ISA, and everything in DBIC is C3.
>> >
>> > Assuming that's correct, I'll take a crack ad a CAG::C3...which in
>> > theory is simply the same as CAG with get_super_paths overridden to use
>> > caculateMRO()....
>> >
>> > ?
>>
>> Or, am I overthinking this. C3 just changes the ISA orders right? So, if
>> it's done by the time I need to surf ISA...does it matter?
>>
> 
> It does matter.  get_super_path implicitly uses depth-first-search
> instead of C3.  The "right" answer in 5.9.5+ is to use
> mro::get_linear_isa($class), which honors C3 ordering when
> appropriate.  The mro.pm in 5.9.5 was intentionally given a 1.x
> version number so that I could then public 0.x versions on CPAN to
> offer some backwards-compat-ish interfaces.  In CPAN mro.pm,
> get_linear_isa could be implemented by looking at whether
> $Class::C3::MRO exists and the class is defined there, etc.
> 
> So I guess what I'm saying is that CAG and other modules that like to
> walk the @ISA tree manually should be doing "use mro; my
> @ordered_classes_to_search = mro::get_linear_isa($class)", but I
> haven't gotten around to publishing mro.pm on CPAN for pre5.9.5 perls.
> 
> -- Brandon
> 
> 

Given that I understood about 1% of that... :-)
Would using 'calculateMRO' in a CAG::C3->get_super_paths($class) for now
still be more correct at this point?

I'd assume that right now, we're lucky in that there aren't really any
edge cases where we depend on get/set_inherited that span classes in a
diamon pattern....most of the time, it's just a simple single
inheritence with a parent...

-=Chris

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to