Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Do you know where your variables are?
 
PerlMonks  

Re: Moose role with requirement consuming another role

by moritz (Cardinal)
on Jul 20, 2011 at 10:09 UTC ( #915624=note: print w/ replies, xml ) Need Help??


in reply to Moose role with requirement consuming another role

I don't quite understand your approach. If role Role::App requires the attribute gazpacho that role App::FixIt provides, why not not simply compose App::FixIt into Role::App?


Comment on Re: Moose role with requirement consuming another role
Select or Download Code
Re^2: Moose role with requirement consuming another role
by Boldra (Deacon) on Jul 20, 2011 at 10:21 UTC
    My second example (with gazpacho), was really just meant to show that I understand the importance of the with/has order when a class consumes a role. Perhaps I over-emphasized it.

    The real problem is not with class<-role(requirement), but, similar to my first example, class<-role<-role<-role(requirements). Or to go into yet more detail, I have about 30 app classes which consume one of two specialized App roles, these both consume a generic App role, which consumes three further roles, MooseX::Getopt, MooseX::SimpleConfig plus our own app-logger role.

    I can easily drop the requirement in the app-logger role and everything works fine. I'm just curious if there is a better solution.



    - Boldra

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-04-19 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls