From: Yuval Kogman Date: Thu, 26 Jun 2008 09:35:53 +0000 (+0000) Subject: update FAQ X-Git-Tag: 0_55~90^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce21ecc578e3154f99399f49bde10e93bf390afa;p=gitmo%2FMoose.git update FAQ --- diff --git a/lib/Moose/Cookbook/FAQ.pod b/lib/Moose/Cookbook/FAQ.pod index 9f1092c..e9aeb6f 100644 --- a/lib/Moose/Cookbook/FAQ.pod +++ b/lib/Moose/Cookbook/FAQ.pod @@ -78,26 +78,17 @@ because it makes sub classing your class much easier. If you need to affect the constructor's parameters prior to the instance actually being constructed, you have a number of options. -First, there are I (See the L -for a complete example and explaination of coercions). With -coercions it is possible to morph argument values into the correct -expected types. This approach is the most flexible and robust, but -does have a slightly higher learning curve. - -Second, using an C method modifier on C can be an -effective way to affect the contents of C<@_> prior to letting -Moose deal with it. This carries with it the extra burden for -your subclasses, in that they have to be sure to explicitly -call your C and/or work around your C to get to the -version from L. - -The last approach is to use the standard Perl technique of calling -the C within your own custom version of C. This, -of course, brings with it all the issues of the C solution -as well as any issues C might add. - -In short, try to use C and coercions, they are your best -bets. +To change the parameter processing as a whole, you can use +the C method. The default implementation accepts key/value +pairs or a hash reference. You can override it to take positional args, +or any other format + +To change the handling of individual parameters, there are I +(See the L for a complete example and +explaination of coercions). With coercions it is possible to morph +argument values into the correct expected types. This approach is the +most flexible and robust, but does have a slightly higher learning +curve. =head3 How do I make non-Moose constructors work with Moose? @@ -292,4 +283,4 @@ L This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -=cut \ No newline at end of file +=cut