Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to RMI

Tags:

java

rmi

I have a small Java SE application, it´s practically a fat client sitting on top of a database. To further my Java skills, I decided to make a client-server application out of it. The server application communicates with the database and handles all kinds of lengthy operations, while the client application only receives the results, mostly ArrayLists of moderate length and primitives.

To this end, I started reading on RMI and did the Oracle tutorial, which I found surprisingly difficult to understand and even get to work.

Is there anything else I can use instead of RMI, without having to dive into JavaEE?

like image 504
Jannis Alexakis Avatar asked Mar 25 '14 07:03

Jannis Alexakis


2 Answers

One way I would suggest would be to use JSON as the format for data exchange. You can use GSON to convert the data from Java objects to JSON and back. The transport could be done directly on the HTTP protocol using REST. You can use Jersey as a REST server/client or roll your own (since you don't want to use JEE, which Jersey is part of).

like image 74
stepanian Avatar answered Oct 10 '22 11:10

stepanian


SIMON is as simple to use as RMI, but with fewer traps in the initial setup. It also has some advantages over RMI. Here is a simple hello-world example:

http://dev.root1.de/projects/simon/wiki/Sample_helloworld110

like image 2
Alex Avatar answered Oct 10 '22 11:10

Alex