[Warszawa-pm] Role w Moose

Zbigniew Lukasiak zzbbyy w gmail.com
Śro, 22 Kwi 2009, 16:06:03 PDT


Było dzisiaj omawiane - wiec zacytuję:

Roles (also knows as Traits outside the Moose community) are a
solution to the issues with multiple inheritance, and a method of code
reuse. They basically allow you to compose chunks of additional
functionality onto your class.

Rather than have base class(es), and method resolution which falls
back if the method isn't defined in your parent class, the
functionality is injected _directly_ into your class, as if you had
copy and pasted the role definition into the code.

This means that things like conflicting methods (same method name
being composed by two roles) can be caught *at compile time*, which is
awesome.

http://www.catalyzed.org/2009/04/catalyst-58-released.html#more

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/


Więcej informacji o liście Warszawa-pm