However, RMI must be carefully introduced into existing source code. This design technique minimizes source-code changes and can create a more flexible application. In this article, I'll show how applying the Adapter design pattern can make retrofitting your code much easier.
Online tutorials are also available on the Patterns homepage.
RMI distributes an existing application's components across multiple systems. Initially, you must use RMI's protocol for making remote method calls. It would be beneficial, however, if most of your source code could keep using its existing protocol. The Adapter design pattern solves that problem by providing access to an object through a protocol that that object does not directly support. Since an adapter class wraps up another object, it is frequently referred to as a wrapper class.