[Bioperl-l] UniGene modules now in CVS

Hilmar Lapp hlapp@gnf.org
Sat, 4 May 2002 17:14:36 -0700


> -----Original Message-----
> From: bioperl-l-admin@bioperl.org 
> [mailto:bioperl-l-admin@bioperl.org]On
> Behalf Of Ewan Birney
> Sent: Thursday, May 02, 2002 3:34 AM
> To: Heikki Lehvaslaiho
> Cc: lstein@cshl.org; Andrew Macgregor; bioperl-l@bioperl.org
> Subject: Re: [Bioperl-l] UniGene modules now in CVS
> 
> 
> On Thu, 2 May 2002, Heikki Lehvaslaiho wrote:
> 
> > Lincoln Stein wrote:
> > 
> > >  > which is somewhat redundant. A more generic way would be:
> > >  >
> > >  > $io = Bio::ClusterIO::IO->new(-file=>'myfile',
> > >  >                                -format=>'unigene');
> > >  > $clu = $str->next();
> > > 
> > > Yes, but Bio::SeqIO uses next_seq().
> > 
> > I know, but in my opinion it should be next(). Attaching 
> the object type to
> > the method name is again that kind of redundancy, I'd like 
> not to have.
> > Having a generic method name makes it easier to inherit and 
> use the classes. 
> > 
> 
> 
> But *I* prefer having the object name as there is no point that I know
> where someone wants to call ->next() on a clusterIO or 
> ->next() on a seqIO
> and somehow deal with either object - in other words, I think it is
> helpful to remind people what sort of object is coming out of next.
> 
> 
> YMMV of course.
> 
> 

I agree with Ewan. It's not only that, I've also seen that quite
frequently in Java interface method naming. What is more important, it
actually enables you to write classes that implement more than 1
interface, which quite often comes in handy if the methods to implement
aren't that heady. I.e., the 'redundancy' actually enables you to do
something you wouldn't be able to otherwise. In the given case the
methods aren't necessarily lightweight, but as general rule I'd prefer
interface method names be rather specific about what they are supposed
to do.

	-hilmar
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp@gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------