FreeBSD.software
Home/devel/p5-MooseX-Role-Parameterized

p5-MooseX-Role-Parameterized

1.11

Roles with composition parameters

Roles are composable units of behavior. They are useful for factoring out functionality common to many classes from any part of your class hierarchy. See L<Moose::Cookbook::Roles::Comparable_CodeReuse> for an introduction to L<Moose::Role>. While combining roles affords you a great deal of flexibility, individual roles have very little in the way of configurability. Core Moose provides C<-alias> for renaming methods and C<-excludes> for ignoring methods. These options are primarily for resolving role conflicts. Depending on how much of a purist you are, these options are I<solely> for resolving role conflicts. See L<Moose::Cookbook::Roles::Restartable_AdvancedComposition> for more about C<-alias> and C<-excludes>. Because roles serve many different masters, they usually provide only the least common denominator of functionality. To empower roles further, more configurability than C<-alias> and C<-excludes> is required. Perhaps your role needs to know which method to call when it is done processing. Or what default value to use for its C<url> attribute. Parameterized roles offer a solution to these (and other) kinds of problems.

Origin: devel/p5-MooseX-Role-Parameterized
Category: devel
Size: 86.4KiB
License: ART10, GPLv1+
Maintainer: perl@FreeBSD.org
Dependencies: 5 packages
Required by: 20 packages
$pkg install p5-MooseX-Role-Parameterized

Dependencies (5)

Required By (20 packages)

More in devel