Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swing and Java EE server

I have a stand-alone, Swing application that uses Hibernate for its persistence layer. I need to extend this to a three-tier system, so that there will be multiple instances of the Swing application and a central server. The client is a stock trading platform, so it will contain a lot of business logic. The server will be responsible for mostly persistence operations and some business logic.

What would be the best way to implement the server for my needs? EJB3 or Spring? What is the best practice for Swing applications to interact with a server? I don't want to go with RMI since not only is it becoming obsolete but also there is no guarantee that the clients and the server will be on the same network.

like image 732
Tom Tucker Avatar asked Nov 06 '22 10:11

Tom Tucker


1 Answers

If the client is a Java client, I don't see the point of using web services (and thus having the overhead of the object to XML serialization) and I would go for EJB 3.x.

For me, the major benefits (beyond performance and scalability) that you get with a good container are fault-tolerance and fail-over (both on the server side and client side, especially with Stateless Session Beans if they are idempotent). For a stock trading platform, this matters.

Also note that using EJB3 doesn't necessarily exclude using Spring for the glue (on the client side and/or the server side).

And if the need to expose your services as web services should arise (e.g. for another non Java client), just annotate them with JAX-WS annotations.

like image 119
Pascal Thivent Avatar answered Nov 11 '22 06:11

Pascal Thivent