Iterators/vectors (was: [Biocorba-l] BSANE and bioCORBA)

Martin Senger senger@ebi.ac.uk
Thu, 31 May 2001 23:39:19 +0100 (BST)


> 
> I agree that the single Iterator object with the next_n() function is
> an improvement of the separate Vector/Iterator objects that BioCorba
> already has. I'd like to see this change
> 
> The implementation does feel a bit awkward to me. Right now it uses
> an out parameter to return the object from the iterator, and uses a
> boolean return value to specify whether the object was returned or
> not. I greatly prefer the current BioCORBA model where the return
> value is the object,
>
   The problem with the current model is that it returns just one object.
I think it's better to have a way to return more objects in one go. It can
be achieved either by having next_n return a list of objects, or an 'out'
parameter having a list of objects. The difference between these two
approaches is only in having possibility to return a boolean or not.
Having boolean as a retun value has the advantage that we need one method
less (we do not need has_more() method.
  Although I thing that it is not big issue I feel that implementation
with 'out' parameter and returning boolean is easier and also it saves one
network call.
   I do not like raising any Exception as a "normal" behaviour - that
makes the codeclumsy and less readable.

   Matin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger@EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger