[Biococoa-dev] mutable sequences
Koen van der Drift
kvddrift at earthlink.net
Thu Aug 11 22:03:06 EDT 2005
I hope everyone is enjoying a nice summer.
A main part of the app I am developing is a sequence editor.
Basically it is a subclass of NSTextView that displays the string
obtained from a BCSequence object. Since right now BCSequence is an
immutable object, I am wondering what would be a good strategy to
implement the editing. One possibility that comes to mind is
everytime that the user edits the sequence (observed by a
textDidChange notification from the textview), I recreate the
BCSequence object and swap it with the current one. The nice thing
about this is that it allows live editing, so characteristics of the
sequence can be updated while typing (maybe even using bindings?).
The negative part, of course is that after each keystroke (or
actually after each notification) I need to create a new sequence
object from an NSString, which can be costly, and/or slow things down.
So an alternative solution could be using a mutable BCSequence
object, and then just add/remove the BCSymbols corresponding to the
keystrokes. I remember that Alex and Charles have been talking/
chatting about a mutable sequence object, but I did not really follow
that discussion. What is the current thought about mutable sequences,
and how could it be implemented into BioCocoa?
More information about the Biococoa-dev