Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: moose role that uses a class that does the role

by tospo (Hermit)
on Jun 28, 2012 at 15:15 UTC ( #978954=note: print w/ replies, xml ) Need Help??


in reply to Re^2: moose role that uses a class that does the role
in thread moose role that uses a class that does the role

I guess this sort of recursion won't work as a role. A role can not depend on one of the classes it is consumed by, it should be independent and only define functionality that can be consumed by various classes. Cleary, this separation is not possible here.

So, why a role at all? Are there really other classes that are very different from Group that can also cluster? If they are similar to the Group class then I think this would better be designed using inheritance, where Group implements the "cluster" method and then you may have sub-classes of Group (or come up with a new parent that Group is a child of too) which modify the behaviour of Group.


Comment on Re^3: moose role that uses a class that does the role

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978954]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-08-30 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls