3.4. Ordered Structures
One of the most commonly asked questions from those seeing the JavaSpace interface for the first time is “Why can't I get a list of all the entries in a space?” It is a good question, as it is often necessary to iterate through a set of entries. The answer is, quite simply, that the interface doesn't need to provide a way of listing entries, because enumeration is easily accomplished using simple programming techniques.
We already got a taste of these techniques earlier in the chapter when we took a brief look at how a distributed array might be implemented. The basic technique is this: We create lists (or more generally, ordered distributed data structures) by including an index or “position” field in entries. Used in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access