Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing client and J2EE

 
Suresh patel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am bit confused in designing the communication between Swing Client and J2ee, Possible option I am thinking are

Client side
================
1) XML-RPC
2) Web Services
3) HttpURLConnection
4) RMI (would not prefer this due to firewall issue)

Server side
================
Going to use Front controller design pattern


Any suggestion are welcome

Thanks in advance
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to invoke EJBs from a Swing application, you can directly do the lookup. For this, when creating the initial context, you need to give the right URL for the server that you are accessing (which you can google to find out).
 
Suresh patel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem of calling EJB in swing is the firewall ,as it communicate using RMI-IIOP and most of the firewall don't allow the communication
 
mc khan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is a simple type of communication then a simple URL solution would suffice.

If running within the intranet then you can use RMI-IIOP.

If running outside the intranet then I would suggest exposing your session beans as web-services. This should avoid all the firewall issues. However, there are other issues you need to deal with, like session management, etc.

XML-RPC is also a good and simple solution, we use it in our company. However I have not seen this described in any of Sun's material. So, I'll keep away from it, at least for SCEA.

Decide between RMI and web-services. Looking at the conversational state, performance requirements, etc would help you make this decision. I think it's safe to ignore XML-RPC and URL connection.

Good luck!
 
Suresh patel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me
Web-services should be used when the system are heterogeneous but I am not dealing with heterogeneous system as client is also java and server is also java .so I was thinking not to use Web-services.

Java pet store 1.3 version is using simple HttpURLConnection class for server communication so was considering that as one of the option.

Still things are not clear....

Any more suggestion are welcome
 
aleem khan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"webservices should be used only for heterogeneous systems" ..this is a wrong assumption.... It is not mandatory.. actually it is better if it we use webservices in long run..tomorrow if you want you can change the client say .net etc... i believe nothing can replace webservices
 
mc khan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the PetStore does use URL connection, but if you look at the documentation you will find they are using it because the type of communication is very simple. So, if your requirements simple enough then can use URLConnection. Again, how would you manage session, security, transactions, etc. You can also look at REST webservices as an option.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic