1 / 13

Object Spaces

Object Spaces. History. Object spaces is a computing paradigm originated by Dr. David Gelernter at Yale University. A language called Linda was developed to support the concept of global object coordination.

chrissy
Télécharger la présentation

Object Spaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Spaces

  2. History • Object spaces is a computing paradigm originated by Dr. David Gelernter at Yale University. A language called Linda was developed to support the concept of globalobject coordination. • A space is a shared, network-accessiblerepository for objects. Instead of communicating with each other, processescoordinate by exchanging objectsthrough one or more spaces.

  3. ObjectSpace - concept • A space may be transient, or it may be persistent. • An object may be identified usingpropertieslookup; if a desired object is not currently available, a process can wait until one arrives. • Objects deposited in a space are passive. Unlike other models, processes don’t modify objectsin the space or invoke an object’s methods directly. • Tomodify an object, a process must explicitlyremove it, update it, and reinsert itinto the space.

  4. Object spaces

  5. Distributed applications using object spaces • Applications based on object spaces-- • A distributeddata structure: is composed of multiple objects that are stored in one or more spaces. • A distributedprotocol: defines the way participantsshare and modify these data structures in a coordinated way.

  6. Distributed applications using object spaces - 2 Example: • The participants are a set of controllersfor printers. • The data structure is a queue of printing tasks for multiple printers • The protocol may be that each participant will try to coordinate with each other to avoidduplicating the same task and to handle errors.

  7. Distributed applications using object spaces - 3 Example applications - chatroom: – auction: – animation production house (see JavaSpaces TM Principles, Patterns, and Practice:Chapter 1--Introduction)

  8. JavaSpaces • Is an implementation which supports the object spaceparadigm. • Is based on Jini – it runs on top ofJini, as a service. • To install the package, you need: • jdk1.2.x • Jini1_0_1 (jini toolkit) • Jstk1_0_1 (java space toolkit)

  9. JavaSpaces - 2 To run JavaSpaces, you need an infrastructure in place: • An HTTP server, used to download code to JavaSpaces clients. • An RMI Activation Daemon, for managing the states of Jini services. • A Lookup service: for Jini service location (reggie). • A JavaSpaces service (outrigger). • Optionally, a transaction service (mahalo).

  10. JavaSpaces API import net.jini.core.lease.Lease; import net.jini.space.JavaSpace; // to access a JavaSpace JavaSpace space = SpaceAccessor.getSpace(); // to deposit a net.jini.core.entry.Entryobject into the JavaSpace SpaceObject msg=new SpaceObject(“SWE622”); space.write(msg, null, Lease.FOREVER); // to read an object from the JavaSpace SpaceObject template=new SpaceObject(); SpaceObject result = (SpaceObject)space.read( template, null, Long.MAX_VALUE); ref: textbook, p. 406

  11. Samples From: JAVASPACES PRINCIPLES, PATTERNS, AND PRACTICE http://java.sun.com/docs/books/jini/javaspaces/ Chapter1/HelloWorld, HelloWorld2

  12. Advantages of using JavaSpaces(Freeman, et al) • Simplicity. • Expressive: “Using a smallsetof operations, wecan build a large class of distributed applications without writing a lot of code.” • It supports loosely coupled protocols. • It eases the burden of writing client/server systems: the functionalities of the server are provided for free, via the spaces; in most cases only theclient code needs to be written.

  13. Sources of information • The Nuts and Bolts of Compiling and Running JavaSpaces Programs: have links for downloading packages and installation instructions. http://www.jiniworld.net/document/javaspace/The Nuts and Bolts of Compiling and Running JavaSpaces(TM).htm • O'Reilly Network: First Contact: Is There Life in JavaSpace? [Apr. 05, 2001]

More Related