Differences and use of RMI, Socket and JPA

Asked

Viewed 1,147 times

5

I am new in java and would like a help to understand better RMI, Socket and the JPA, and better understand their utilities and when applied, because I don’t see much to choose between them. I did a lot of research, but I found a lot of technical stuff that didn’t help me much.

  • John, RMI, Socket and JPA are completely different things. It’s a little strange that you want to "choose" between these technologies. Are you just wanting to learn or do you have some real problem you’re facing? How did you come to the conclusion that you should choose one of these technologies? Perhaps it would be better to change your question and describe the problem better, otherwise it would be too broad to address all possible aspects of each of these technologies.

  • Sockets basically transmit low-level data between remote programs. RMI (Remote Method Invocation) is a little higher level and allows you to run a method of a remote program, waiting for the return as if it were a local method call. JPA (Java Persistence API) is basically an object-relational mapping API to access database without writing SQL. Well, I’ve summarized everything, but I doubt a survey would give you those definitions. Therefore, it is essential that you be clearer in telling exactly what your problem is. Hug!

  • This part had even done the research, and yes it is for learning, I want to see if I can create a client/server system on the web where the server(web) would send the commands to a program (client) that would run, at first I saw that the alternative would be the RMI but I did not find so much content of the theme for beginners.

  • RMI is not for client/server on the web. I recommend studying some Restful API like JAX-RS or Spring MVC. If you really want to send a server notification to the client (this is not always really necessary), study how to use Websockets. It is possible to do this with Spring as well.

  • @utluiz Thanks for the light, I will study yes!

2 answers

1

  • RMI (Remote Method Invocation) is an API that serves for you to make remote method calls. For example, you can run a method on another computer.
  • Socket would be a connection point between two computers. It would be the IP and Port of a computer.
  • JPA is a specification. It’s a specification that allows you to do object-relational mapping. What would it be? Is you can convert an object-oriented code into a code from a database.

My definitions were somewhat simplistic, I hope you understand.

1

As commented, these three technologies have VERY different purposes. It makes no sense to compare them.

  • Remote Method Invocation (RMI) is a protocol used by Java for communication between different processes (programs).
  • Java Persistance API (JPA) is a mini-language that persistence frameworks (e.g. hibernate) use to work with databases.
  • Socket is a point of communication between processes through a computer network. It is low level concept, including RMI uses sockets.

Think about what you want to develop and study relevant technologies calmly! Don’t try to learn everything at once. Any questions, we are here :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.