[Chicago-talk] Moose Role naming conventions

Elliot Shank chicago.pm at galumph.com
Mon Apr 12 21:24:37 PDT 2010


On 4/12/10 2:38 PM, Sean Blanton wrote:
> Since Moose Roles go into the same package format as regular classes,
> how are people organizing them so they can be distinguished from classes
> that use them?
>
> A) Through namespace, as in:
[chop]
> B) through the package names (I think I'm going to go with this one):
>
> My::Dog
>
> My::Dog_GuideRole
>
> My::Dog_StrayRole

$rover->does('My::Dog_StrayRole')?

Blech.

> C) or you don’t care at all about the fact that a .pm file might be a
> Moose role:
>
> My::Dog
>
> My::Dog::Guide
>
> My::Dog::Stray

I'm for this one.

See Stevan Little's own opinion on role naming: http://perl.markmail.org/thread/k77octqrujt5w2pb

> I’d like to hear what others consider when making a decision.
>
> Does a Moose role even have to be a package?

It needs a namespace like anything else does.


More information about the Chicago-talk mailing list