I know that the Java can use the Socket Programming to send an Object. Apart from socket programming, anything other way to do it?
Via web service for example. But its build on top on sockets again.
Java's Remote Method Invocation (RMI) is probably the easiest and most widely supported way.
Java's Advanced Socket Programming describes marshalling objects over a socket.
Control a high-speed robot hand to type it in.
Pretty well every other thing you can do will be a layer built on sockets.
Serialize the object, write to a file, copy the file if the computers are network connected if not use a removable disk and deserialize it.
- Attach rubber band to computer A
- Put Object in rubber band.
- Pull back, aim at Computer B.
- Let go.
Objects can be transferred via a shared database.
I work near a production system that's been doing this for 10 years.
Ironically, except in rare cases, DB connections are also implemented via sockets.
No. Sockets are how computers communicate. Other than writing the data to some media and physically transporting it between computers, you will have to use sockets.
At the lowest level, data is transferred over sockets as bytes. So first you need to serialize your object to bytes, then you can send it, then on the other side you need to deserialize the object from the bytes.
Approaching your question less literally, there are Java libraries that handle the serialization automatically and hide the nastiness of dealing directly with sockets. I recommend KryoNet. KryoNet can do remote method invocations, and a lot simpler and more efficiently than Java's built-in RMI support.
I wrote a blog post on how to send objects from Java to .NET. You can use the same technique to send objects between applications on the same platform.
http://ferozedaud.blogspot.com/2009/11/how-to-send-object-from-java-to-net.html