I am building an application with java enterprise and glassfish. The information between client and server will usually be small amounts of data, but from time to time the client will need to get a larger resource (1-20 MB would be typical). I am still planning the architecture of the system, and I need some advice about how to expose resources on the server to multiple clients.
Originally I was only going to have a desktop client app running in the ACC provided by javaws and glassfish. I put the remote interfaces in a separate jar, and planned to do all client server interfacing by calling EJB methods exposed through those interfaces. This is all fine and well for a java desktop client. It should even be pretty easy for an android client. But I don't think its going to be as easy for ios.
Is there any way I can call my EJBs from the objective-c running in an iphone or ipad? I surely hope so.
Im anticipating that the solution is a RESTful web service. From what I understand this is a way to loosely couple client and server applications by passing the data in a generic XML or JSON form.
Sorry if I am missing something very obvious, but it seems like there are two routes from here:
keep my EJB business interface and implement a duplicate restful interface for generic clients (iOS and whatever else might come up later).
create one restful interface for all clients.
number 2 seems like a much cleaner design, but it means I have to scrap work ive already done and learn about rest. Can someone with more experience offer some suggestions? I would appreciate it so much.