views:

1193

answers:

5

I am currently looking to set up a client/server application. I am planning on having the clients written as a Swing thin client. I am not really sure how I should set up the Server side application. The Java Server side application would have the application business logic, database access, etc. I see a lot information on the web about setting Java Server side applications that are use Web front ends. So I see a lot of information on Tomcat and full application servers like JBOSS, etc. Since I'm not going to be using a web front end I am not exactly sure how I should set up the server. I have been looking at Spring as well as JEE. Are these my best options? Are there other options that I'm not thinking of? Should I use them together or is it something that I can use separately? If I am only going to be using JEE do I need a full application server like JBOSS, Weblogic, Websphere, etc or is this over kill? If I also want to use JMS, should I use an application server as well or are there alternatives? My first thoughts are that an application server is kind of over kill but I'm not exactly sure.

Thanks in advance for all your thoughts!

+1  A: 

An application server is an over kill if you are not using the features provided. If your application have only JSP and Servlets then Tomcat is a better choice. If using EJBs then you need an application server like Jboss.

First thing you have to decide is how your swing client will interact with your server. Are you going to use HTTP protocol, EJB lookup, simple RMI, etc?

If your client will be used by people who sits outside of your server network then you should use HTTP protocol so Servlets are the best choice. You can expose your server as webservice as well. If the client users are in the server network then you can use anything like EJB or socket programming or even http here as well.

You can certainly use Spring in your server and client. Spring is a big framework, you need to decide what features you want to utilize. Spring can be used in servlet environment, EJB environment or any other environment.

Bhushan
Using HTTP/HTTPS is certainly a good choice for communication because you have much less problems with firewalls and proxies. In a similar situation (SWT 'thin' application + Tomcat) we use Spring httpinvoker for communication between the clients and the server.
Csaba_H
A: 

http is a good but simple protocol which probably can do what you need.

To get inspired, try playing with the Jetty server (an alternative to Tomcat) - it has a simple Ajax based chat client as one of the demo applications which might be a basis for whatever you need to do.

Get version 6 from http://dist.codehaus.org/jetty/jetty-6.1.19/

I would recommend keeping it simple so you do not need a huge number of architectural libraries which you all need to learn.

Thorbjørn Ravn Andersen
A: 

Maybe you should take a look at CaptainCasa - I once saw this on the JAX conference. They seem to provide a nice-looking Swing client, but handle all the logic stuff on the backend. I have no personal experience with the product, but from what they presented it looked quite interesting for "dumb" clients.

Daniel Schneller
+2  A: 

I think I'm pretty much in the same situation like yours. I'm planning to go ahead with Swing + Spring + JPA. The remoting shall be done through Spring Http Invoker. The only downside is you need a servlet container like Tomcat or Jetty to route the http requests to the Spring beans. But servers like winstone (which Hudson CI use) are quite lightweight and can be embedded in the application.

Having a Spring back-end will mean that you don't need an application server. But should you need an application server in future, Spring can seamlessly support that as well.

James
A: 

An application server will probably be the easiest solution. You might consider creating a RESTful api on the server side, which can be done with spring on an application server. Then you can use a simple http client library on the client side.

Matthew Sowders