IBM considers Project Zero to be an "incubator" for exploring ideas without ties to previous architectures. However, this is not exactly open-source development, the site declares:
HTTP
Project Zero architecture
The central problem of a RESTful Web service is interpreting the URI and headers of a request routing it to the correct process so the desired representation is returned. In Project Zero architecture, processing an HTTP request can be thought of as firing a sequence of events. Each step accomplishes some phase of logical processing and may lead to the next step or an error. Advanced programmers can create their own event handling code. The default event processing sequence goes like this:
- requestBegin - Builds a data structure representing the request.
- secure - Requests which do not pass security checks cause return of
a HTTP error code and control passes to the log step.
- GET, PUT, POST, DELETE - The HTTP method and URI are used to locate code to generate the response.
- log - Records according to the log configuration settings, always runs.
- requestEnd - Clean up of resources used, always runs.
Note that only the method and URI are used to locate the code to generate a response. This is done through configuration files and a doXXX method naming convention in scripts. In other words, in step 3, if the request method is GET, the application will look for doGET methods in the scripts for a particular URI. Selection of the output rendering method to create the desired return type ( HTML, XML, JSON, etc.) is up to the programmer. Project Zero provides a library of Groovy and PHP "renderers" which can handle many of the typical output formats. For example, the Groovy template facility lets you create mostly static HTML page templates which get a few request specific values filled in during rendering.
Configuring Zero server
Project Zero makes extensive use of the Apache Software Foundation Ant make tool and the related Ivy dependency manager to coordinate assembly of all the parts of an application. Ant and Ivy files are in XML format. JavaScript Object Notation (JSON) script files are used extensively for application configuration and initialization of data structures where other toolkits might use XML or properties files.
The Zero Resource Model for Database Driven Applications
Following the MVC paradigm used in so many Web service architectures, Project Zero has the Zero Resource Model (ZRM) which uses JSON to define and declare databases (models) using conventions that simplify coding applications. Given a database defined with ZRM conventions, you can quickly create Ajax style dynamic HTML pages which use the Dojo toolkit, has been integrated into the Project Zero distribution.
Using the Eclipse plugin for Zero
Following the instructions on the Project Zero site, I started Eclipse (version 3.2.2 required) and set the search for new features path to the Project Zero update location. After agreeing to the license, Eclipse smoothly added Groovy support and examples plugins for the current Project Zero version (M7). Although the Project Zero site gives some information on what Java request handlers should look like, the current plugin emphasizes Groovy and does not contain a Java example. Given the ease with which Groovy scripts can call Java objects and libraries, using Groovy to interface with existing Java objects should be easy.
Contrast with JAX-RS
Project Zero will obviously be competing with Sun's JAX-RS API as used in the Jersey project for developer mindshare, so lets compare the two. The most obvious difference is language support. Although written partly in Java, Project Zero emphasizes the scripting languages Groovy, PHP and JavaScript. In contrast, JAX-RS is completely centered on Java and depends extensively on Java annotations, although JSON output is supported, application code will be in Java.
A developer's right to commercial use of Project Zero is tightly controlled in IBM's
"community-driven commercial development" license and is currently tied to the WebSphere world. In contrast, the JAX-RS specification is freely available and has at least four independent implementations including the open-source Jersey project. Some JAX-RS implementations permit very compact RESTful services.