Class::MixinFactory::NEXT(3pm)

Class::MixinFactory::NEXT3pm

Superclass method redispatch for mixins

Usage

  use Class::MixinFactory::NEXT;
  package My::BaseClass;  
  sub foo { return "Foo Bar" }
  package My::Logging;
  sub foo { warn "Calling foo"; (shift)->NEXT('foo', @_) }
  package My::MixedClass;
  @ISA = ( 'My::Logging', 'My::BaseClass', 'Class::MixinFactory::NEXT'; );
  package main;
  print My::MixedClass->foo();

Overview

Enhanced superclass method dispatch for use inside mixin class methods. Allows mixin classes to redispatch to other classes in the inheritance tree without themselves inheriting from anything.

Public Methods

This package defines one method, named NEXT.

  $callee->NEXT( $method, @args );

Searches the inheritance tree of the callee until it finds the package from which NEXT is being called, and then continues searching until the next class which can perform the named method.

Unlike SUPER, this method will backtrack down the inheritance tree to find implementations later in the search path even if they are on a separate branch.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 3 times.

  1. 6.0–9
  2. 10
  3. 11
  4. 12–13

From libclass-mixinfactory-perl 0.92-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.