[Catalyst-commits] r8861 - in Catalyst-Manual/5.70/trunk: .
lib/Catalyst/Manual
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Sat Dec 13 11:35:04 GMT 2008
Author: t0m
Date: 2008-12-13 11:35:03 +0000 (Sat, 13 Dec 2008)
New Revision: 8861
Modified:
Catalyst-Manual/5.70/trunk/Changes
Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/ExtendingCatalyst.pod
Log:
Fix the manual to encourage you to use MRO::Compat, rather than Class::C3 directly
Modified: Catalyst-Manual/5.70/trunk/Changes
===================================================================
--- Catalyst-Manual/5.70/trunk/Changes 2008-12-13 11:13:06 UTC (rev 8860)
+++ Catalyst-Manual/5.70/trunk/Changes 2008-12-13 11:35:03 UTC (rev 8861)
@@ -1,5 +1,9 @@
Revision history for Catalyst-Manual
+ - Change use of Class::C3 to MRO::Compat, as rafl tells me
+ this is best practice, and gives you native next::method in
+ 5.10. (t0m)
+
5.7014 04 Nov 2008
- Remove a reference to a FOREACH loop that did not exist (RT #39046)
- Changed some Template Toolkit links to perldoc links (RT #38354)
Modified: Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/ExtendingCatalyst.pod
===================================================================
--- Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/ExtendingCatalyst.pod 2008-12-13 11:13:06 UTC (rev 8860)
+++ Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/ExtendingCatalyst.pod 2008-12-13 11:35:03 UTC (rev 8861)
@@ -110,8 +110,8 @@
While Catalyst itself is still based on L<NEXT> (for multiple
inheritance), extension developers are encouraged to use L<Class::C3>,
-which is what Catalyst will be switching to in some point in the
-future.
+via MRO::Compat, which is what Catalyst will be switching to in the
+5.80 release.
When overriding a method, keep in mind that some day additionally
arguments may be provided to the method, if the last parameter is not
@@ -119,7 +119,7 @@
invocant off of C<@_> and assign the rest of the used arguments, so
you can pass your complete arguments to the original method via C<@_>:
- use Class::C3; ...
+ use MRO::Compat; ...
sub foo { my $self = shift;
my ($bar, $baz) = @_; # ... return
@@ -277,9 +277,11 @@
methods code. You can surround this by overriding the method in a
subclass:
- package Catalyst::Action::MyFoo; use strict;
+ package Catalyst::Action::MyFoo;
+ use strict;
- use Class::C3; use base 'Catalyst::Action';
+ use MRO::Compat;
+ use base 'Catalyst::Action';
sub execute {
my $self = shift;
@@ -291,8 +293,10 @@
}
1;
-We are using L<Class::C3> to re-dispatch to the original C<execute> method
-in the L<Catalyst::Action> class.
+We are using L<MRO::Compat> to ensure that you have the next::method
+call, from L<Class::C3> (in older perls), or natively (if you are using
+perl 5.10) to re-dispatch to the original C<execute> method in the
+L<Catalyst::Action> class.
The Catalyst dispatcher handles an incoming request and, depending
upon the dispatch type, will call the appropriate target or chain.
@@ -306,7 +310,7 @@
package Catalyst::Action::OnlyMondays; use strict;
- use Class::C3;
+ use MRO::Compat;
use base 'Catalyst::Action';
sub match {
@@ -548,7 +552,7 @@
package Catalyst::Plugin::UriforUndefWarning;
use strict;
- use Class::C3;
+ use MRO::Compat;
sub uri_for {
my $c = shift;
@@ -573,8 +577,9 @@
class' C<new> method to return the component object.
You can override this method and do and return whatever you want.
-However, you should use L<Class::C3> to forward to the original
-C<COMPONENT> method to merge the configuration of your component.
+However, you should use L<Class::C3> (via L<MRO::Compat>) to forward
+to the original C<COMPONENT> method to merge the configuration of
+your component.
Here is a stub C<COMPONENT> method:
@@ -582,7 +587,7 @@
use strict;
use base 'Catalyst::Component';
- use Class::C3;
+ use MRO::Compat;
sub COMPONENT {
my $class = shift;
More information about the Catalyst-commits
mailing list