niklas
niklas

Reputation: 3011

Client Server Communication - Java Server

We are planning to write an application that, in its start phase will be accessed by about 100 users a day who will send a total of ~1000 requests to a server.

We decided to choose Java as the server language (most of the programmers` favorite). As we want to have flexible interfaces and the interface designers (Iphone, php, javascript) we do not want to rely on java specific solutions for client display(JSF...)

The server will also run a database with some thousands of entries. User management is also needed. It will mainly be about database requests. Maybe a typical example of a Service Oriented Architecture?

Methods will mainly store, retrieve data from the database.

What I am looking for is a suitable Way/Framework to implement that. Is SOA the right approach? Is it too big for this use case? Is JSON a good means of returning the results to the clients? How to trigger methods on the server via (safe) requests.

I am trying to figure out some options. Experience?

Upvotes: 0

Views: 4567

Answers (3)

niklas
niklas

Reputation: 3011

i found a Paper: RESTful Web Services vs. “Big” Web Services: Making the Right Architectural Decision that is dealing with the issue

Upvotes: 0

Mattias Isegran Bergander
Mattias Isegran Bergander

Reputation: 11909

One option would be Restful webservice and for example use Java EE 6 (jax-rs), pretty simple.

Simple example from one of the links below:

// The Java class will be hosted at the URI path "/helloworld"
@Path("/helloworld")
public class HelloWorldResource {

    // The Java method will process HTTP GET requests
    @GET
    // The Java method will produce content identified by the MIME Media
    // type "text/plain"
    @Produces("text/plain")
    public String getClichedMessage() {
        // Return some cliched textual content
        return "Hello World";
    }
}

If you would like it to return json instead just change the Produces annotation: @Produces(MediaType.APPLICATION_JSON) or let the client decide which it prefers by specifying multiple options: @Produces({"application/xml", "application/json"})

The Java EE 6 Tutorial chapter about RESTful webservices http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html

Java EE 6 introduction http://www.oracle.com/technetwork/articles/javaee/javaee6overview-141808.html

This stack overflow reply and links seem very useful for beginners too: https://stackoverflow.com/questions/3882082/rest-json-web-services-java-ee-framework

Upvotes: 1

ControlAltDel
ControlAltDel

Reputation: 35096

Seems like a perfect case for building web services using EJB 3. Last time I was doing this (around 6 or 7 months ago) I was using netbeans which I highly recommend for just getting started with building a few web services and testing them out

Upvotes: 1

Related Questions