ShippyDippy
ShippyDippy

Reputation: 53

Analogy for remote and distributed objects

I'm trying to understand what is the difference between remote and distributed objects. I know this might be a simple concept and I'm probably too dumb to understand but can someone explain in layman's terms what they are or a very simple programming example(does remote mean local or private variables?, Is it similar to making something serializable?) or even better if they can provide an analogy (if any). Thank you so much!

Upvotes: 1

Views: 228

Answers (1)

Basil Bourque
Basil Bourque

Reputation: 338181

Same thing.

Object-oriented programming (OOP) defines a paradigm where objects message one another (or invoke methods on one another, whichever way you want to define it).

Distributed objects means technology that gives the objects the freedom to live in separate spaces, able to message one another across processes or even across machines. To quote Wikipedia:

Distributed objects … are distributed across different address spaces, either in different processes on the same computer, or even in multiple computers connected via a network, but which work together by sharing data and invoking methods.

The goal of distributed objects is to let them interoperate in the same manner whether living together in one process on one machine, or whether living separately. See also, Remote object communication on Wikipedia. Java provides a Java-centric distributed objects technology called Java Remote Method Invocation (RMI); see Wikipedia. CORBA is similar, a standardized approach to distributed objects that works across programming languages and platforms, in contrast to RMI being Java-specific.

The word “remote” in this context would merely emphasize or clarify that a particular object is not on the same machine, so access requires network access. And network access means slower speeds, more latency, and higher risk of failure.

You asked:

does remote mean local or private variables?,

No, totally different.

  • Local or private variables is about variable scope.
  • Regarding distributed objects and networking, local and remote refers to being on the same machine versus being on different machines and needing the network to communicate.

Unfortunately, the information technology industry frequently recycles words, using the same words in different ways for different meanings. Context is everything.

You asked:

Is it similar to making something serializable?) or

Serialization as a general term is about writing the data stored within an object (its “state”) to some external format (binary or textual) that can be consumed by other software at some other place or time. Such communication of state is needed when sending an object as the message between distributed objects.

Java Serialization is the name of a specific technology implementation and format for serializing Java objects. The purpose might for communication between distributed objects, but not necessarily. You could also use Java Serialization as a way of writing back-ups to disk, as one example.

Java Serialization is used in some technologies for communicating between distributed objects. But there are other ways to communicate the state of an object.

Be aware that Java Serialization has some serious security implications, FYI, and may be considered harmful where used in untrusted scenarios.

You asked:

even better if they can provide an analogy (if any)

I can give you an example. Suppose you build and deploy a system for your company that handles order fulfillment and logistics. Your system has modules, one module for invoicing, and one module for shipping.

Eventually your system grows to the point of burdening your server hardware. And your shipping info module has grown in sophistication to the point that you want to leverage it for use with other systems, and/or provide your customers with access to it.

So you decide to break out the shipping module to run on its own, on a separate machine in a different part of your network. But you want to maintain the same paradigm of object calls between your original invoicing system and your now-separate shipping system. So you decide to use RMI to hook the two systems together in a way that works the same as when they lived together in the same space. Very little of your original code need be changed.


Distributed objects have been declining in popularity, as Web Services technologies have met some of the same needs. However, distributed objects technologies solved decades ago some problems (security, discovery, and more) that were later encountered by the Web Services world, with solutions being reinvented all over again. So distributed objects are still viable in some scenarios, and should not be dismissed out of hand.

Upvotes: 1

Related Questions