What is the easiest framework to transfer POJOs between Java programs?
Asked Answered
M

4

5

I need a framework to transfer POJOs between two (or more in a client/server model) Java programs over TCP/IP. I need it to be as simple as possible but it must support several clients per server, and easy implementation of encryption is a plus.

So far I have looked at Java RMI, JRemoting, AltRMI and NinjaRMI. Right now JRemoting looks like the best choice as it is simple and don't require strange and seemingly unnecessary extends and implements as most of the others do. No active development seems to be going on on any of them except a little on Java RMI. I don't know if that is because they are stable and don't need more development, or because these kinds of frameworks are just not "cool" any more.

The POJOs are just bags of properties. I need the server to hold a static list of objects, and the clients must be able to (1) Read the list, (2) Add an object to the list, and (3) Remove an object from the list.

Any suggestions?

Metalinguistics answered 4/5, 2011 at 8:22 Comment(0)
P
4

You could probably use any serialization technology, for example you could use JSON and add on encryption and compression later in order to cutdown the amount of traffic you are sending. JSON has the advantage of being language agnostic, so you don't restrict the implementation of either side of the connection.

Many JSON libraries are available; see json.org.

Pygmy answered 4/5, 2011 at 8:31 Comment(0)
B
2

Do you need to do remote method calls, or are your POJOs just bags of properties? If the latter, it would probably be easiest to just use plain Java serialization.

Buffer answered 4/5, 2011 at 8:30 Comment(1)
Yes, the POJOs are just bags of properties. I need the server to hold a static list of objects, and the clients must be able to (1) Read the list, (2) Add an object to the list, and (3) Remove an object from the list.Metalinguistics
A
2

look here: http://code.google.com/p/google-gson/

Alexandrina answered 4/5, 2011 at 8:32 Comment(0)
T
2

You can have a look on Protocol Buffers. I think Google uses Protocol Buffers internally.

Tetter answered 10/5, 2011 at 12:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.