On 23/10/2011 7:45 PM, Lukas Renggli wrote:
I do not see how BTreePageOuter is used? Is that your own class? What does that have to do with BTree? I wrote my own BTree, mainly as a learning exercise. I had a look at the other version, but it made my head hurt. Turns out mine is about 20% faster than the version on squeaksource for adds, and nearly twice as fast for deletes. I Sounds cool, but IMHO correctness and customizability to different database layers is more important than speed.
Generally it is a bad idea to subclass collections. I am not sure, but Is that a general smalltalk principle, or just in regards to Goods?? This is general to Smalltalk. Subclassing from concrete collections inherits you way too much behavior that exposes way too much of the internal structure. Subclassing introduces subtle bugs and hand hard to detect dependencies.
For example, did you think of overriding #removeAllSuchThat: in your OrderedCollection subclass? If not, I bet that soon somebody starts to use it and completely breaks all constraints of a B-Tree.
Um, sub-classed or in a variable, what's to stop them doing that either way? J