Java Reference
In-Depth Information
In truth, there's more to RMI than your interface, implementation, and a stub. Early
versions of RMI required both stubs and skeletons , which are server-side classes that bear
the responsibility of communicating between the stub and the served object. You built
these skeletons, like the stubs, using the RMI compiler rmic . Today, with the rise of the
Java reflection interfaces, RMI applications need only stubs; in fact, as you'll see later in
this chapter, not even stub classes are required when using the RMI package tailored for
Java ME.
The Java RMI model has its advantages over proprietary and traditional web services
approaches, including the following:
Object orientation : The RMI model extends the Java execution model in a seamless
way, letting you pass Java objects across the RMI interface. This lets you continue
to use object-oriented techniques and design patterns when constructing your
application.
Security : The RMI model leverages Java's existing security model.
Legacy support : Servers providing RMI services can connect to legacy services
through JNI calls, letting you wrap legacy systems in Java interfaces and integrate
them into your networked applications.
These advantages make RMI attractive in many situations, especially with consumer
electronics applications in the set-top box market, where security and integration with
large-scale legacy computing has been an ongoing effort since the late nineties. At the
same time, RMI is somewhat dated, having originated in the mid to late nineties. In com-
parison with its chief competitor, the XML- and HTTP-based web service model, it can be
seen as lacking, especially in the following areas:
Interoperability with web services : The web services model has become the leading
client/server architecture pattern in many markets. Connecting an RMI applica-
tion to an existing web service requires additional work similar to that required by
connecting an RMI application to any other legacy application.
Weight : RMI comes with a size penalty on the platforms that support it; RMI
requires the CDC and the Foundation Profile for mobile devices. This requires
significantly more robust hardware than does the Java ME web services imple-
mentation, which can run atop a CLDC platform. In addition, the RMI protocol
can be significantly more expensive over wireless links than a carefully designed
web service exchange.
 
Search WWH ::




Custom Search