[Catalyst] NEXT vs SUPER in the catalyst handle_request cycle

Brandon Black blblack at gmail.com
Tue Nov 21 00:05:48 GMT 2006


On 11/20/06, Michael Reece <mreece at vinq.com> wrote:
>
> i will, but not until the warnings in Catalyst::Plugin::C3 are less
> foreboding.
>
> but let's pretend i am talking about Class::C3 instead; my question still
> stands.
>
> should i just call next::method in all cases, or is it only appropriate for
> certain overrides?  is there an easy way to determine when to use one (NEXT
> or Class::C3) versus the other (SUPER)?
>

Generally speaking, it's more correct to always use NEXT or
next::method instead of SUPER when working in an MI hierarchy based on
NEXT or Class::C3.  All three ways have very different sets of rules
for walking @ISA.  In many trivial cases, SUPER, NEXT, and
next::method will all resolve your call in the same manner, but one
subtle change in some underlying base class could break that and cause
all three to resolve things differently from each other.

-- Brandon



More information about the Catalyst mailing list