15.6. A Remote Object Factory

There is a different design approach that we could take to this problem. Within RMI, you can imagine there being two types of remote objects: those that are accessed remotely, through stubs and skeletons, and those that are actually mobile and move between the client and server systems.

We've already seen the requirements for remotely accessible objects: They must have an interface that extends Remote, and an implementation that extends UnicastRemoteObject. But the only requirement for a mobile object is that it implement Serializable, which puts far less of a burden on the class designer to rework the class to be RMI compatible.

Table 15.2. Components in the RMI “Mobile Objects” Application
New Components
Name

Get J2EE™ and JAX™: Developing Web Applications and Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.