Database Management for Smalltalk

Virtual Collections

Virtual Collections

 
VirtualCollection, VirtualDictionary etc are new collection subclasses built on B-trees, which grow and shrink gracefully and are efficient for large numbers of elements; only those collection elements and interior tree nodes which receive messages are read into the image cache.  The virtual collections inherit their public behavior from their non-virtual superclasses, VOLargeOrderedCollection, VOSortedDictionary etc, which are independently reusable, being just subclasses of Collection with subclasses implemented as virtual objects. 

There is nothing ’special’ about the virtual collections, they are just new collection classes which happen to have been implemented using virtual objects; however they do all send the message #becomeVirtual to each object just before addition, so virtualizing the object into the virtual space in which the virtual collection exists; this has no effect on already virtualized objects whichever virtual space they exist in.