Would You Find this Moose Role Useful?

Comments

Just a note - without JS turned on (from all the many sources on this page), your post contains a few empty spaces where the code should be present. Why couldn't you just use a plain PRE element (or whatever) for the code? It seems to be a github gist thing in your case, but it's an overkilll for that.
I thought I'd try the gist, since it seems all the other kids are doing that in their blogs. But if it's barrier to communication I'll do something else next time. Thanks!


this is cool
As confirmation to your idea, I've somewhat done this recently for work code. Things were config driven (though not Bread::Board, much simpler) and it cut out a lot of boiler plate code every time I wanted a class to be able to access the logger, for example.
nperez: What I've been doing in the past is create a custom role for each class that could be 'aggregated' (not sure about the best term here), which did cut down on boilerplate line noise. Up until now that's typically what I did, just I've done maybe 20 roles like that and noticed redundancies. Would be great to see your version as I try to code up a generator. I'll try to put something on github later today for comments. Thanks for the feedback (and still looking for a name, right now it's "MooseX::Role::BuildAggregrateAttribute" although considering "MX::Role::BuildInstanceOf" as well. Not even sure this belongs in the MooseX:: namespace.

Post a comment

Already a Vox member? Sign in

John Napiorkowski

About Me

John Napiorkowski
United States
Talking about Perl Web Application Development

My Groups

  • POE
    POE Updated: 5 days ago
  • LAMP
    LAMP Updated: 5 days ago
  • Perl
    Perl Updated: 5 days ago

Neighborhood

Explore friends, family, friends & family, or entire neighborhood.

Archives

Developer Blogs