6.5. Summary

In this chapter we've investigated some tried-and-true frameworks for space-based applications that are simple, powerful, and quite general. First, we studied the replicated-worker pattern, which is appropriate for solving computational problems that can be broken down into a number of smaller, independent, nearly identical sub-problems. A master generates tasks and collects results, while workers repeatedly pick up tasks and compute results. The framework is well suited to building parallel applications that speed up solutions to a large class of compute-intensive problems. The second pattern we explored, the command pattern, represents a powerful way of using spaces to pass around object behavior. The pattern allows us to create a generic compute engine that is ready to take on any kind of tasks we throw at it, without needing to know anything about their specifics. The final application pattern we investigated in detail was the marketplace pattern, which provided a general framework for producers and consumers of some resource to interact to find the best deal. The resource may be any product or service that can be bought and sold—computing cycles, electric power, cars, or anything else.

Beyond these three patterns, we gave a brief overview of some more specialized and ad hoc application patterns, such as blackboards, trellises, and collaborative patterns. The patterns of this chapter, while not exhaustive, give you a foundation for starting to invent and develop your own. As the JavaSpaces technology matures and programmers develop more real-world applications with it, the body of useful patterns will no doubt grow. Please check this book's web site at http://java.sun.com/docs/books/jini/javaspaces for patterns contributed by readers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset