Yes, Project Zero really does deserve the "New Beginning" label. With this project, IBM is making a completely...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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:
This community is an experiment in a new way to build commercial software, an approach we are currently calling Community-Driven Commercial Development.
There will shortly be commercial products based on Project Zero, IBM WebSphere sMash and IBM WebSphere sMash Developer Edition. These developer platforms provide visual tools for creating applications with a minimum of code writing. The name sMash is obviously intended to suggest ease of creating "mashup" applications, which draw resources from a variety of services. It is not clear to me whether or not deployment of Project Zero applications outside the WebSphere world will ever be possible.
Current state of developmentPresently Project Zero is releasing new versions every month or so. At this time it is at "Milestone 7" roughly similar to the JAX-RS (Jersey) project which is also at version "early access 0.7" with roughly monthly releases. Note that JAX-RS is an evolving standard with Jersey as the reference implementation while Project Zero is evolving independently of any standard except 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
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
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.