in reply to perl writing tips needed
A role is a collection of methods (and maybe attributes). When you compose a role into a class, it looks (nearly) as if you had written the methods right in the class, the role is "flattened" into the class.
So you could write roles that provide various methods, and then compose them into the "main" class (if you need it - it might also be possible to just compose it into the classes where you actually need them).
see Moose::Role for a nice Perl implementation of roles.
|
|---|