+ Object Oriented
Perl5 / Moose / |
Perl Moose Definitions
- extends - This function will set the superclass(es) for the current class.
- has - This will install an attribute of a given $name into the current class.
- required => (1|0) - This marks the attribute as being required.
- weak_ref => (1|0) - This will tell the class to store the value of this attribute as a weakened reference.
- lazy => (1|0) - This will tell the class to not create this slot until absolutely necessary. If an attribute is marked as lazy it must have a default or builder supplied.
- Class Metadata - the ability to have your code examine the structure of your objects
- Coercion - the ability to convert types of one type to another when necessary
- Method Modifiers - the ability to add code that runs before, after or around an existing method
- Roles (Object Factory) - The ability to add pre-defined functionality to classes without subclassing. With the role option, you specify the name of a role or a role type whose "interface" then becomes the list of methods to handle. The "interface" can be defined as; the methods of the role and any required methods of the role. It should be noted that this does not include any method modifiers or generated attribute methods (which is consistent with role composition).