Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Moose role with requirement consuming another role

by Arunbear (Parson)
on Jul 20, 2011 at 11:11 UTC ( #915632=note: print w/ replies, xml ) Need Help??


in reply to Moose role with requirement consuming another role

Your Role::Logger role looks like an "interface role" in the sense described in Roles Versus Abstract Base Classes, and your Role::App is being used like an abstract base class.

But this type of usage doesn't seem to be (officially) supported


Comment on Re: Moose role with requirement consuming another role
Re^2: Moose role with requirement consuming another role
by Boldra (Deacon) on Jul 20, 2011 at 12:49 UTC
    I can see how my simplified example matches that description of an interface role, but in reality the Logger Role has six attributes and 200 lines of code, it's not just a list of 'requires'.

    "this type of usage doesn't seem to be (officially) supported" == "I can't find it in the doc either"

    ?



    - Boldra
      Role::App being used like an abstract base class is what is at odds with the documentation (regardless of whether or not the Logger Role is an interface type role).
        No, none of my roles are abstract base classes, they all provide additional functionality. Role::App reads the config file, creates objects based on its contents, and provides methods for fetching these objects.

        Anyway, I can't see how a class which inherits from another class (or a role) could be called an abstract base class - it's not at the base. But perhaps you are using a different definition.



        - Boldra

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-12-28 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls