[Biojava-dev] Errors versus Exceptions
Michael Heuer
heuermh at acm.org
Thu May 20 02:44:59 UTC 2010
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