Friday, December 30, 2005

JavaSpaces

Making it stick.: Jini/JavaSpaces/Rio... and Jython?

The above article makes mention of JavaSpaces. This is technology I've only heard about, but seems really cool. The best analogy I can come up with is that JavaSpaces does for objects what NFS does for files.

By using NFS, all of a sudden your typical applications now have access to networked files. NFS does all the work, and your once non-distributed application becomes distributed.

JavaSpaces does the same thing for your objects. JavaSpaces allow you to store objects in a "space", where that space can be remote or local. Other JVMs can share and access that space. As I understand it, you could have one program simply put a Service object in a space and have another program access that same Service object from anywhere.

Like NFS, you have a bit of a performance penalty, but it's more than offset by the boost the technology provides.

Now all I need to do is a find a good excuse to use JavaSpaces and I can replace all this theory with fact.

2 comments:

  1. You can certainly publish service object's into a JavaSpace. Generally, however, you post services into Reggie the JINI lookup service.

    What tends to go in JavaSpaces is tasks (executable code) or data/messages destined for some recipient to act on. You can imagine tasks to be the equivalent of a Runnable.

    In terms of philosophy, the best examples of JavaSpaces applications tend to have some kind of flow of objects/tasks/data to them. You might also think about protocols when considering design options.

    Last but not least, JavaSpaces eliminate a whole bunch of the common concurrency issues one faces such as locking etc. In fact, the API tends to highlight such issues in your design/code very early on which is immensely powerful.

    Okay, I've ranted enough for now. If you do get around to playing with this stuff do subscribe to JAVASPACES-USERS and checkout http://www.dancres.org/cottage/javaspaces.html.

    Dan Creswell
    http://www.dancres.org/

    ReplyDelete
  2. Dan,

    Thanks so much for the terrific description of JavaSpaces and for setting the record straight about the best use of the technology.

    I had never thought about using it in the fashion you described, but it seems really powerful.

    And any technology that can simplify concurrency is worth looking into.

    Thanks.

    ReplyDelete