|JavaSpaces Principles, Patterns and Practice|
|author||Eric Freeman, Susanne Hupfer and Ken Arnold|
|summary||A comprehensive resource for anyone developing distributed applications using JavaSpaces.|
The BookJavaSpaces technology is a high-level coordination tool for gluing processes together into a distributed application. For a technology that has to handle latency, synchronization, and partial failure the API is very simple and easy to use. JavaSpaces is based on the "Linda" coordination language developed at Yale University. Two of the authors, Dr. Freeman and Hupfer have spent a decade in designing and implementing space based applications as part of the Linda research group and the third Ken Arnold was in charge of the JavaSpaces project at Sun Microsystems.
The book teaches the principles, patterns and practice of JavaSpaces technology.
The principles are very simple. The API is very minimal with just seven methods and that is all you need to write distributed applications using JavaSpaces. There is a tutorial introduction to the API and by the end of chapter two, you will be able to write your own distributed applications. The building blocks for space based programming is distributed data structures. The distributed version of arrays, shared variables, and unordered data structures are described in the chapter "Building Blocks". The concepts of leases, distributed events and transactions are covered in detail in separate chapters.
The patterns in distributed programming are those of synchronization, communication and application. One of the main concerns in distributed programming is synchronization. But this task is simplified in JavaSpaces as synchronization is built into the space operations. The synchronization chapter covers implementing semaphores, using multiple semaphores, using various synchronization techniques like round robin and barrier, and finally the readers/writers problem. In the loosely coupled communication style of space based programming the senders and receivers can remain anonymous. The communication patterns are variants of the distributed data structure---channels. The chapter on Application Patterns presents the frameworks for solving compute-intensive problems like ray tracing or generating computer animations and frameworks for producers and consumers of resources.
All these concepts are put together to develop two real world applications to show the practice of JavaSpaces. The first one is a collaborative application---an interactive messenger service and the other is a parallel application for breaking password encryption. These examples cover everything from the basics, to useful distributed data structures to advanced topics like distributed events, transactions and leasing.
The final chapter of the book provides a list of resources for further reading both for JavaSpaces and its foundation the Jini technology. The appendix includes the official specs of JavaSpaces from Sun Microsystems.
What's to consider?
For people new to JavaSpaces this book is a good tutorial introduction. If you write distributed applications in some other language, you will find the patterns section of the book very useful, where you can learn how to implement the common patterns using JavaSpaces. The individual methods of the API are covered in detail and finally the broad picture is presented where the different pieces fit to solve a problem.
Even if you are not in the field of distributed application development, you can read through the book to get an understanding of this new programming paradigm. The narrative is smooth and all the concepts are illustrated with code samples and interesting examples. Each chapter of the book has an associated set of exercises. These exercises prompts the reader to explore his understanding of the topic by enhancing the examples described in the chapter.
This book serves both a tutorial as well as a reference. If you are new to JavaSpaces or are an experienced distributed application developer, this book will be a valuable resource.