Database Management for Smalltalk

Should I virtualize an OrderedCollection?


Q:  “If an object has an OrderedCollection as an attribute which contains a list of other objects in the virtual space, do I need to send the #madeVirtual message to the actual OrderedCollection object?”

A:  You don’t need to, but you can if you want to.  It’s entirely up to you how to organise the granularity; the only rule is that anything which is to be referenced by more than one virtual object must be a separate virtual object itself i.e. have been sent #madeVirtualIn: before assignment or #becomeVirtualIn: after assignment (but that’s slow).

If the OrderedCollection is small and frequently accessed then make it part of its parent virtual object i.e. don’t send it #madeVirtualIn:, but if it’s large or infrequently used you may prefer to make it a separate virtual object, so that it is not read from disk being part of its owner, only if sent a message; the elements of the OrderedCollection should themselves be separate virtual objects if they are referenced by any other virtual object, but if they are, for example short Strings that would be unnecessary and inefficient.  If in doubt, use a VirtualCollection and consider optimising to an OrderedCollection later, when the application is better understood.

VirtualCollection and VirtualDictionary etc are Btrees in which each Btree node is a separate virtual object, which is much more efficient for large collections, and not much slower for small ones.

Leave a Reply

You must be logged in to post a comment.


 

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://wplinksforwork.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://hemoviestube.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215