Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Moose role with requirement consuming another role

by Arunbear (Prior)
on Jul 20, 2011 at 11:11 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://915632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-18 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found