Iterator/size() (was: [Biocorba-l] BSANE and bioCORBA)

Juha Muilu muilu@ebi.ac.uk
Fri, 01 Jun 2001 16:17:24 +0100


Alan Robinson wrote:
> 
> On Thu, 31 May 2001, Ewan Birney wrote:
> 
> > The other thing I would *really* like is to remove the
> >
> > get_PrimarySeqVector
> >
> > from PrimarySeqDB and replace it with
> >
> >
> > get_PrimarySeqIterator
> >
> >
> > The vector call is almost unimplementable for most DB implementations I
> > have got, where as the Iterator is trivially implementable. Alan - this is
> > your baby here - can we change this?
> 
> I'll contend that it was not me that wanted vectors!!
> 
> I'd go a step further and ask if we need Vector objects at all in the IDL?
> 
> I'm happy to go with just having Iterators (N.B. having an optional
> 'size()' method *might* be handy, so you have an idea how many objects are
> in the collection [returns '-1' if unknown, or throws an 'unknown'
> exception?]).

Perhaps the size() method should not be in the iterator. Iterators are
used (at the moment only) only with collections who already knows how
many elements they have. Iterators are more like auxiliary entities.

For example the AnnotationHolder has a method num_annotations (in the
BSA method was in the BioSequence interface)

The method can be a pain as you said, because server impl must scan all
the elements (e.g.. annotations in this case). Are people happy to have
the size()/num_XXX() methods?

The method can simplify client implementations and thus effort put on
the server side pays back (there will be easily more client
implementations)

> 
> Alan.
> 
> --
> ============================================================
> Alan J. Robinson, D.Phil.             Tel:+44-(0)1223 494444
> European Bioinformatics Institute     Fax:+44-(0)1223 494468
> EMBL Outstation - Hinxton             Email:  alan@ebi.ac.uk
> Wellcome Trust Genome Campus
> Hinxton, Cambridge
> CB10 1SD, UK                http://industry.ebi.ac.uk/~alan/
> ============================================================
> 
> _______________________________________________
> Biocorba-l mailing list
> Biocorba-l@biocorba.org
> http://www.biocorba.org/mailman/listinfo/biocorba-l

-- 
 +--------------------------------------------------------------------+
 |Juha Muilu, Ph.D., EMBL Outstation| Email:  muilu@ebi.ac.uk         |
 |European Bioinformatics Institute | Phone:  +44 (0)1223 494 624     |
 |Wellcome Trust Genome Campus      | Fax:    +44 (0)1223 494 468     |
 |Hinxton, Cambridge CB10 1SD, UK   | http://industry.ebi.ac.uk/~muilu|
 +--------------------------------------------------------------------+