The Restlet open-source project delivers Java support for the Representational State Transfer architectural style.
Addressing the issue of bringing Java development more in line with the needs of Web 2.0 developers, an open-source project has emerged to deliver Java support for the Representational State Transfer architectural style.
Jerome Louvel, a developer based in Levallois-Perret, France, has established a project known as the Restlet project to create a REST framework on top of the Java Servlet API.
Louvel, who serves as an independent consultant specializing in Java development and business process integration as the founder of Noelios Consulting, said his mission with the Restlet project is to "bring the simplicity and efficiency of the REST architectural style to Java developers."
However, Louvel said he does not want to revive the debate of SOAP (Simple Object Application Protocol) versus REST, as it "has been discussed too many times already."
The Servlet API has been around since 1998 and has been widely adopted as a way to generate dynamic content on HTTP servers.
The Servlet API "basically tries to represent a HTTP request/response cycle in an object-oriented model," Louvel said in a paper describing his Restlet project. "Along with Java Server Pages, its sister specification, it [Servlet API] became part of a larger effort to bring Java technologies inside companies."
However, this may not be the best approach for Web 2.0 development, Louvel said. His desire to support REST drove his effort to create Restlet, he said.
"While powerful for complex centralized models, the object-oriented paradigm isnt the best suited for Web development," Louvel said. "Java developers need to realize this and start thinking more REST-fully when developing new Web services or AJAX-based Web clients. The Restlet project is providing a simple yet solid foundation that can get you started right away on the Web 2.0."
Web 2.0 fails to meaningfully define the evolution of the Internet, claims John Pallatto. Click here to read more.
Yet, Louvel noted that some developers have concerns about whether Restlet has advantages over other Web 2.0 development frameworks such as Ruby on Rails and Struts.
Essentially, the motivation for the Restlet effort came when "I recently started the development of a Web site," Louvel said. "I wanted it to comply with the REST architectural style as much as possible. After many researches, I noted the lack of a REST framework in Java," he said.
So Louvel said he developed his own REST framework on top of the Servlet API. "I was able to develop the first Restlet connector, an HTTP server connector, directly issuing REST uniform calls," he said.
In addition, Louvel said he wanted "to get rid of the unnatural separation between the client-side and server-side view of the Web in Java."
Louvel noted that "in todays networked environment, we shouldnt have to make such differences: Anybody should be able to act, at the same time, as a Web client and as a Web server. In REST, every component can have as many client and server connectors as useful, so I simply developed a client HTTP connector based on the HttpURLConnection class."
Louvel said he then decided to break the Restlet project into two parts. The first is a generic set of interfaces known as the Restlet API and some helper classes to register a Restlet implementation, he said. The second part of the project is a reference implementation of the Restlet API called the NRE (Noelios Restlet Engine), which includes "an HTTP server connector; HTTP, JDBC [Java database Connector and SMTP [Simple Mail Transfer Protocol] client connectors; a set of representations; and a DirectoryRestlet able to serve static files from a tree of directories with automatic content negotiation based on file extensions," Louvel said.
The Restlet API supports all REST concepts, including resource, representation, data, connector and components, Louvel said.
Still in beta, the latest release of Restlet is Version 0.18 and is available for download at www.restlet.org/downloads/restlet-0.18b.zip.
The Restlet API and Noelios Restlet Engine are distributed under CDDL (Common Development and Distribution License).
And the Restlet project dependencies include J2SE 5.0, also known as Java 5; Jetty 5.1.5 or 6.0 beta; FreeMarker 2.3; and JavaMail 1.3.
Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.
Darryl K. Taft covers the development tools and developer-related issues beat from his office in Baltimore. He has more than 10 years of experience in the business and is always looking for the next scoop. Taft is a member of the Association for Computing Machinery (ACM) and was named 'one of the most active middleware reporters in the world' by The Middleware Co. He also has his own card in the 'Who's Who in Enterprise Java' deck.