[Bioperl-l] Moose and Roles

Mark A. Jensen maj at fortinbras.us
Tue May 26 19:37:22 UTC 2009


I think I'd want to go completely Moose-y and call them Bio::Role::.x 
(The 'I' is sort of a semantic kludge, as I understand it)
MAJ
----- Original Message ----- 
From: "Chris Fields" <cjfields at illinois.edu>
To: "BioPerl List" <bioperl-l at lists.open-bio.org>
Sent: Tuesday, May 26, 2009 2:50 PM
Subject: [Bioperl-l] Moose and Roles


> 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
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
>



More information about the Bioperl-l mailing list