[Bioperl-l] Moose and Roles

Chris Mungall cjm at berkeleybop.org
Tue May 26 20:26:31 UTC 2009


This seems to be overloading the namespacing mechanism. Presumably  
each $X in {Root,Seq,Phylo,...} etc will need their own roles. Would  
these go in Bio::Role::$X:: or Bio::$X::Role::?

For the names I prefer either (a) the convention of using adjectives  
or adjectival phrases to denote roles or (b) spelling it out rather  
than using hungarian notation (e.g. DescribableRole rather than  
Describable)

On May 26, 2009, at 12:37 PM, Mark A. Jensen wrote:

> 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
>>
> _______________________________________________
> 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