[Bioperl-l] Moose and Roles
Chris Fields
cjfields at illinois.edu
Tue May 26 19:51:28 UTC 2009
I agree. And, yes, the 'I' is a kludge of sorts to indicate an
interface. I'll use that namespace for the time being.
chris
On May 26, 2009, at 2: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
>>
More information about the Bioperl-l
mailing list