[Biojava-l] SimpleSymbolList changes

Matthew Pocock mrp@sanger.ac.uk
Mon, 03 Jul 2000 12:47:00 +0100


Humph.

If we change size() to return a long, will that cause anybody any
problems?

I like the idea of SimpleSequence delegating to a ResidueList object
that portion of its implementation. That seems like a GOOD way to re-use
implementation code.

I don't have strong feelings about using a List or a Symbol [] to stoor
the underlying list of symbols. But, re-using List does mean that some
code is already written for us. Anyway, all of this is hidden behind
interfaces, so it doesn't impact user-land anyway. The important thing
is that it works. Well done Thomas for spotting this & working arround
it.

Mutable sequences scare me. If nobody has pressing needs to build
mutable sequences, could we leave them out of 1.0? I like Ewan's
sudgestion of commit() methods writing changes from local objects to
stoorage - I think that this is how we were invisiging editable acedb
working. If mutability is needed, then I favour adding mutator methods
to ResidueList that by default throw UnsupportedOperationException, and
adding a vetoable SomethingChanged events/liteners framework. That way
you can make an implementation mutable, and still prevent it from
changing, and all the views can be synced and if you want you can mirror
changes to a DB or a GUI, or accross a corba client-server or..., ok - I
got carried away.

Matthew

Thomas Down wrote:

> Since the Lurking Horrible ArrayList Bug was blocking me,
> I decided to get on and rewrite SimpleSymbolList.  I hope
> the changes don't step on anyone's toes -- feel free to
> back this out (or ask me to do it) if there's a problem.
>
> For 99.9% of applications, there should be no noticable
> change at all (other than the new implementation being
> smaller, and maybe a fraction faster ;).  What has changed
> is:
>
>   - the constructor SimpleSymbolList(Alphabet, List) now
>     validates the Symbols in the supplied list, and can
>     consequently throw an IllegalSymbolException.  This
>     has a number of (minor) internal knock-on changes,
>     but I doubt it will affect end user code.  At most,
>     just add an extra try block.
>
>   - I'd like to make SimpleSymbolLists immutable.
>     Currently, there is a single mutator method
>     (addSymbol), which I have implemented, but also
>     deprecated.  I'd rather see SimpleSymbolList
>     become immutable, and write a new SymbolList
>     implementation with a richer set of mutator methods.
>     But for now, no code is affected.
>
> I've also rewritten SimpleSequence to act as a viewer on an
> existing SymbolList, rather than copying it, but I haven't
> checked this in yet.  Will do next week, if everyone is happy.
>
> Thomas.
> --
> He looked up with big brown eyes.  ``They're really only
> tiny little A-bombs, honest.''
>                                      -- David Brin.
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l

--
Joon: You're out of your tree
Sam:  It wasn't my tree
                                                 (Benny & Joon)