[Bioperl-l] Moose and Roles
Chris Fields
cjfields at illinois.edu
Tue May 26 18:50:58 UTC 2009
All,
(If you aren't interested in Moose, feel free to ignore)
I'm toying a bit with Moose to get some basic BioPerl-like classes
rolling. One thing that's popping up early is refactoring interfaces
(Bio::IdentifiableI, Bio::DescribableI) into simple Roles. Since
roles are geared towards particular actions a class performs (a class
'Foo' does role 'Bar'), how do we want to name these to not confuse
them with regular classes? Interface convention for BioPerl was
affixing the class name with 'I'; we could affix these with
'R'/'Role'. Or should we have a specific Bio::Role namespace?
Suggestions welcome!
chris
PS: Here's the basic syntax in Moose-ish (very simple):
# role
package Bio::DescribableR;
use Bio::Root::Role;
has description => (
is => 'rw',
isa => 'Str'
);
no Bio::Root::Role;
package Foo;
use Bio::Root::Moose;
with 'Bio::DescribableR';
# description gets mixed-in, not inherited
More information about the Bioperl-l
mailing list