views:

143

answers:

1

A little context: I would like to separate the Java application I'm writing into a more or less typical server-client model. I would provide a "server" which takes care of business logic and persistence, but write it in a very service oriented fashion. Any front-end code (GUI) would then call upon the server to provide the functionality in a user friendly fashion.

As I'm writing the application using Spring (and an ORM framework), it would make sense to explore the usual suspects to expose the server functionality, with the usual suspects being RMI, Spring HTTP, Hessian, web services, etc (the Spring natively supported options). These are well well documented, both in reference documentation and on here.

However, for the actual question: are there any less obvious, more exotic options I could consider to use for exposing my server services?

It's important (as always) to get the right balance between ease of use (from a front-end POV), performance and scalability. For example; since I've thought about providing the Spring-BlazeDS integration in the server any way (for Flex/AS3 clients), it dawned on me that BlazeDS provides a Java-native API for calling AMF services.

Any pointers are much appreciated.

+4  A: 

I would recommend BlazeDS if you have a Flex front end and Spring HTTP if not. Both eliminate the non-productive work introduced by having to translate XML to objects and back again.

Spring HTTP is especially attractive because you can write POJO Spring service interfaces just as you always do, deferring the choice to expose via HTTP remoting until the end. You keep your options open that way. If you decide that Spring web services work better for you later on, you can keep re-using the same POJO Spring interface.

duffymo
Am I right in saying that using Spring's HTTP exporter/invoker you essentially force potential clients to use Spring as well (if they wish to call upon these services)? I guess the only truly language/framework agnostic way would be web services.
pHk
Correct. If you use Spring HTTP remoting, clients will have to use the Spring client to get the marshaling/unmarshaling right. Web services are agnostic. Remember that they need not be synonymous with SOAP/XML. Those can lock you in, too. (e.g., Axis) REST is a perfectly good way to go as well.
duffymo
+1 - we use HTTP services all the time in our client-server application, as we only have to worry about Java clients. Works like a champ!
aperkins