On Thu, Apr 23, 2009 at 03:57:32PM +0100, Mark Morgan wrote:
> Cheers to both yourself and Steven Little.  That looks to do exactly
> what I was looking for.  I didn't like my current implementation, but
> couldn't find an alternate way of doing same.

A parameterized role might still be the wrong way of conceptualizing it; for
example, if you just want a way to essentially curry in some defaults for
creating attributes, making some sugar around has() with Moose::Exporter would 
be
better.

It's hard to tell from your example whether there's really a meaningful set of
behaviors encapsulated by this role (and "has some attributes that look like
this, without consistent names" doesn't count).  Depending on the number of
possible values for 'boolean_filters', and their possible variance in
definition, it could make more sense to make a role per filter.  (stevan
suggested this on irc.)

Anyway, roles are awesome, but not the solution to every problem.

hdp.

Reply via email to