RESTSupportBrainstormingIdeas

REST Tooling Ideas

Overview

This wiki page describes some of the ideas and questions we had from a brainstorming session.

Project Types

There are two types of projects that make sense for hosting RESTful services: web and J2SE. For !JavaOne, the goal is to support creating RESTful services in a web project. This is so we can reuse the infrastructure provided by the web project as much as possible.

Deployment Targets

There are four possible options for deploying the RESTful services: Glassfish, Tomcat, build-in httpserver and JAX-WS endpoints. For !JavaOne, we will support deploying to Glassfish and Tomcat only.

  • Question: How important is it to support the build-in httpserver and JAX-WS endpoints? What are the use cases?

Workflow for Creating a RESTful Service in a Web Project

Here is what we think the workflow should be for creating a RESTful service in a web project.

  • Create web project as usual.
  • From the web project node, users can invoke the New -> REST Service action to bring up the REST service creation wizard.
  • The wizard will let the users specify the package name, the RESTBean class name, !UriTemplate and other relevant annotations. Upon completion of the wizard, a RESTBean class file will be generated. In addition, a REST service node will appear under the Web Services node.
  • In the RESTBean class file, users can invoke "Add Operation" action to bring up the editor for creating the operations.
  • In the editor, users can specify the method name, !HttpMethod, !ConsumeMime, !Produce Mime, parameters, etc. Note that for each parameter, users can also specify the !UriParam constrained by the URITemplate.
  • Issue: It appears that the REST implementation is overwriting the web.xml. This needs to be fixed so user data doesn't get lost.
  • Question: It would be nice if we can support invoking EJBs and other web services using the EE 5 annotations and code injection. Would this work with a RESTBean implementation class? (*Answer:* Yes.)

Visual Web Service Designer Integration

It would also be nice if we can use the Visual Web Service Designer we plan to implement for NB 6.0 to create the RESTBean class. Here are some ideas on what the designer can provide as value add:

  * Visually create http methods using !DnD from a palette.
  * Organizes the methods by their HTTP method types. 
  * Provides documentation, e,g, sample URIs, input/output messages and data, etc.
  * JAXB support (post NB 6.0)

Client Support

We can generate test clients similar to the ones in the REST demos.

For client application development, we should provide support for generating inline code for calling RESTful services from POJOs, servlets, EJBs, etc.

There is also the idea of generating a client library that people can pick up and use to invoke the RESTful service very much like what Google and other web 2.0 companies provide.

One idea which arose out of the initial meeting is that it would be useful to generate and publish a human readable description of the rest service. This can be derived from the annotations and/or WADL description.

  • Question: What is the plan for WADL? Is it something we plan to turn into a standard?
  • Question: What about support for languages other than Java such as !JavaScript, PHP, Perl, etc?

Database Support

We also have some ideas with regard to creating RESTBeans from database tables. For example, we could generate a RESTBean with the !UriTemplate keyed to the primary key of the database table and we can then generate methods with code to perform CRUD operation on the entity beans using JPA.

Other Questions

  • Is JSON going to be a supported format?
  • Does it make sense to standardize on some specific URIs and param names? For example, output for output format requested, output=JSON/XML, usage(URI) to get to documentation of the REST service, etc.

Competitive Analysis

Here is a short write-up on the competitive study we did on REST tooling: competitive analysis.

-- Main.PeterLiu - 28 Feb 2007

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo