LuckyLuke
LuckyLuke

Reputation: 49077

How does a Swing client communicate with a Java EE backend?

I want to develop a Swing client application that will use a Java EE 6 backend. How does the Swing client communicate with the server? Do I have to make a web service that the communication go through or are there other ways?

Upvotes: 2

Views: 3392

Answers (4)

Denis Tulskiy
Denis Tulskiy

Reputation: 19177

Yes, you can either create a web service (SOAP or RESTful), but since your client is a java application you can use jndi lookup to call EJB3 beans, it will work through rmi or soap, depending or your configuration. Something like here.

Upvotes: 1

user529543
user529543

Reputation:

There are to many communication types:

  • sockets gives to you the max communication speed.
  • a little communication overhead, you can use XML / SOAP
  • (plain)webservices too : fastest to implement. a HTTP GET, POST
  • RMI: I think is deprecated, but others are using. If you want only with Java backend from Java, you can use it

Upvotes: 1

Brandon Miller
Brandon Miller

Reputation: 2297

I think this might be a very useful document for you, complete with diagrams to demonstrate the architecture and communication modal.

Upvotes: 2

Saul
Saul

Reputation: 18041

There are other ways also in addition to web services.

One very common approach is RMI or Remote Method Invocation. It is a native extension of the Java platform that allows server-side objects to be directly accessible inside client-side code.

RMI overview

If you have no experience with RMI then take a look at the official Java Remote Method Invocation Tutorial

Upvotes: 4

Related Questions