In Part 1 of this article (JDJ, Vol. 7, issue 3) I introduced the idea of
using the surrogate architecture within Jini as a platform for J2ME games. I
also showed how to start Madison, Sun's reference implementation, and how to
connect to it with the provided device simulator.
This article continues the surrogate architecture tour and introduces a
method through which a J2ME device can use it.
To briefly recap, the architecture allows any device, in our case a J2ME one,
to connect to a Jini network through a surrogate object that represents the
device in the network. The surrogate host provides a mechanism for the
devices to register themselves and obtain a context that enables access to
the underlying Jini infrastructure.
Another important reason for choosing the surrogate architecture is that it
allows us to view the device as a single object from the network persp... (more)
Imagine using your J2ME device to participate in a complicated online game
– or a simple one, for that matter. You log in to a network where network
services are elements of the game. You, as a player in a massive online
world, are represented as an object, a peer of all the other game elements.
Your player object becomes the client of a map service, a service that allows
you to explore and move around while delivering necessary display
information. Your object discovers and uses other services as needed, without
prior knowledge of many of them. You meet a creature you’ve never
... (more)