O'Reilly logo

Java RMI by William Grosso

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Build the Client Application

The client application is normally built simultaneously with the server application. Once the server interfaces are defined, server-side development can proceed in isolation. Client developers usually use “fake servers,” which implement the remote interface in trivial ways and run in the client process when developing the client application. This allows server developers a little more freedom to design and develop their part of the application; it avoids forcing them to commit to a total architecture early in the development cycle.

Tip

Another reason why clients and servers are often built simultaneously is that the skills required to build them are fairly distinct. Developers building the client application have to know how to build a good user interface (e.g., have mastered a substantial portion of the Swing toolkit) and don’t really need to read anything in this book past this chapter. People building servers can make do with far less knowledge of the user interface components, but should definitely read the entire book.

In order for this to work, however, client-side developers must take care to heed one simple rule of thumb:

Consume as few server resources as possible, for as short a time as is reasonable.

This rule of thumb has two main consequences: don’t hold connections to a server you’re not using, and validate arguments on the client-side whenever reasonable.

Don’t Hold Connections to a Server You’re Not Using

The client has to connect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required