[Biojava-dev] Errors versus Exceptions

Mark Schreiber markjschreiber at gmail.com
Thu May 20 04:17:43 UTC 2010


Totally agree with Michael. Extensive lazy loading will cause a big
hit on your performance. Be selective in your use, which entirely
depends on your use case. If people are likely to list every sequence
id in the database but only work on a few then you definitely want
lazy loading at this point. When they have selected the few they will
work on you may want to eagerly load those parts they will need (such
as the sequence and feature table). All is entirely dependent on what
your application is for.

I would usually say that an API for general shouldn't specify the
loading mode. It should be configured by the app developer to suite
their application (assuming you are going to share your Ensembl data
binding API).

- Mark

On Thu, May 20, 2010 at 10:44 AM, Michael Heuer <heuermh at acm.org> wrote:
> On Tue, 18 May 2010, PATERSON Trevor wrote:
>
>> Yes... But...
>>
>> If our implementation relies on a lazy load underneath every Sequence method implementation..
>>
>> Then every method can throw an IO type Exception
>>
>> In essence you can instantiate a valid Sequence object with a LazyLoading Reader before you get the valid SequenceData,
>> unlike the case where you can check that you can make a valid Sequence object from the Reader.
>
> Don't make a lazy load Sequence then.  Have the reader populate a (package
> private) memento object, and then use that to create a fully formed
> Sequence.
>
> Lazy loading is a bad smell.
>
>   michael
>
>




More information about the biojava-dev mailing list