Quantcast
Channel: General – Restlet – We Know About APIs
Viewing all articles
Browse latest Browse all 83

10 years of REST APIs in Java

$
0
0

Back in May, we celebrated the 20th anniversary of the Java programming language, and now is the time to celebrate another milestone — the 10th birthday of Restlet Framework, the most used framework to develop and use RESTful APIs in Java! If you are a Java developer working with APIs, chances are, you did interact with the Restlet Framework at some point in your life (and if you did not, check it out now!)

Time flies, and it’s a good opportunity to reflect a bit on the journey so far, what motivated the inception of the framework, the value it has brought to users so far, and what’s the road ahead. With that in mind, I thought there was no better person to tell that story than Restlet’s founder and renowned API wizard: Jérôme Louvel. So when we were together in our office in Palo Alto, I decided to interview him!

Guillaume: For the few out there who are not (yet) familiar with Restlet Framework, can you tell us a little bit about what this framework is all about?

Jérôme: Sure. Basically it consists in a set of classes, interfaces and annotations that Java developers can invoke or extend in order to either provide or consume web APIs.

The core Restlet API captures in Java the main concepts of REST (such as resource, reference, representation, component or connector) and of HTTP (such as method, status, content negotiation, cache control, virtual hosting, idempotency or safetiness).

Then there is a Restlet Engine that implements this Java API, with zero external dependency, and a large set of extensions to provide various types of connectors (Jetty, Apache HTTP Client, Servlet, etc.), or representations (Apache Velocity, Apache FreeMarker, Jackson, JAXB, etc.) or much more.

Back in 2005, it was the first framework that was aligned to REST principles and to HTTP semantics, across all languages, and it remains to my knowledge the most comprehensive one from this regard today.

Guillaume: How did you come up with this idea and need for creating such a framework? Wasn’t it possible to create RESTful Web APIs with the Servlet API for instance?

Jérôme: The framework naturally emerged while building a new web site for which I wanted to closely follow the REST principles from a design perspective. I actually built it first on top of the Servlet API, until I realized that this abstraction layer was generic enough to be useful to other developers. That’s when I extracted it and later launched it as a standalone open source framework.

The Servlet API is a library that provides a raw access to HTTP from a transport level point of view. You can get all the raw HTTP headers, the HTTP method, body and status code and it’s useful. But, it doesn’t provide any sort of high productivity framework that can guide you as a developer to fully use REST and HTTP.

Many MVC frameworks also exists and are popular, but they are not really or not fully based on REST and HTTP principles, but instead on the MVC paradigm that was adapted from the GUI world to distributed computing and the Web. It works but misses important capabilities of the Web and are not a good fit for machine to machine communication either.

Finally, you have RPC and distributed objects protocols (such as RMI, CORBA and SOAP) that apply this old and proven distributed computing paradigm to the Web, but using HTTP as a transport protocol, when it is in fact a full applicative protocol.

Those MVC and RPC frameworks and protocols feel natural to many developers, but miss key aspects of REST and HTTP. That was one of the reasons why the so-called Web Services bandwagon eventually failed due to its misalignment with the Web and unnecessary overhead.

Guillaume: Can you tell us a bit about the key milestones along the journey of Restlet Framework?

Jérôme: After the public launch of the framework in December 2005, we collected tons of feed-back and went through many beta versions to stabilize the Restlet API and its engine, leading to a release of version 1.0 in 2007. During this long maturation phase we tried various Java API styles and ended-up with a pretty stable design.

I also participated as an expert in the JCP group that defined JAX-RS API. Actually, most of its design was actually pretty established based on a prototype that Sun Microsystems had developed internally, so I could only marginally influence its design. But, that participation was useful to think about how Java annotations could be used later in Restlet API to increase the development productivity, and JAX-RS greatly helped to democratize REST among Java developers.

The next 1.1 version released in 2008 was retro-compatible with 1.0, adding support for WADL (the first API description language, long before Swagger and RAML), JAX-RS and a manual port to Google Web Toolkit. The community kept growing and contributing to it in many ways, from additional extensions, bug report, enhancement requests, to a nice illustration as below.

jug

In 2010, version 2.0 was released, adding several editions including Java SE / EE, Android, Google App Engine, Google Web Toolkit. The Restlet API also introduced annotations, but in a more balanced way than JAX-RS and consistently on both on client and server sides of the API, unlike JAX-RS.

In 2012, version 2.1 came out, which added new extensions and an edition for OSGi, migration of community interactions to GitHub, StackOverflow, Twitter and a new Apache 2.0 license option. along with the “Restlet in Action” book published by Manning and written by the core Restlet team.

Restlet in Action

In 2013, the Restlet project turned into a startup with a large round of seed funding, leading to the public beta launch of APISpark (an API PaaS to develop, operate and promote web APIs) and to the opening of an office in Silicon Valley where I relocated with my family.

As the Restlet engineering team grew in 2014 out of our new office in Nantes (West of France), we announced the GA of APISpark, launched Restlet Studio (the first cross-language IDE for web APIs) and released version 2.2 & 2.3 of the framework adding an automatic mapping between HTTP error statuses and Java exceptions (both client and server-side), full support for Swagger and RAML, support JSONP and HTTP PATCH among many other improvements. We also launched our new web site consolidating all our products in one place and finally Sparky was born as our official mascot out of our initial APISpark logo.

140603_apispark_bee_standing_bottomhalo

2015 is the year of customer development for Restlet, with the growth of our marketing team and the arrival of Paul Doscher as our new CEO, bringing his deep experience of commercial open source to the world of APIs, allowing me to focus as a CTO, leading to a new Restlet technology plan for the next 2-3 years. APISpark matured with its first customer case studies, a Cool Vendor recognition from Gartner as a specialized API PaaS, the acquisition of the popular DHC Chrome App for API testing to our products line and finally our participation as a founding member to the Open API Initiative under the Linux Foundation.

It has definitely been a long and very exciting journey so far, and the framework has been core to everything we built so far, so that’s great to have such a mature and solid foundation to build upon.

Guillaume: What are the key features & strengths of Restlet Framework?

Jérôme: In addition to its native and extensive support for REST and HTTP, Restlet Framework has a unique Java API that is consistent on both client and server side, at all levels of abstraction. It is both lightweight at its core (about 500 Kb), very extensible and portable across many Java based environments thanks to its multiple editions.

It can be used in a variety of use cases, without having to learn different Java APIs, from Android mobile applications, to cloud environments with dynamic routing needs, to web backends servicing both static files, data and services.

It is mature and battlefield tested in organizations of all sizes for now 10 years, and its stability makes it a safe choice for the years to come. Its integration with the rest of the Restlet Platform including APISpark, DHC and Studio gives API developers access to the most comprehensive toolbox out there.

Guillaume: Restlet Framework 2.3 is currently the greatest and latest, but what can we expect from the upcoming milestones?

Jérôme: For the next 3.0 version of the framework, we have four main themes planned.

First, at the Java API level, we will extensively support asynchronous and progressive API processing at all levels, using reactive programming and callbacks. We will also fully support JAX-RS API version 2.0, and allow the co-hosting of code written for both APIs at the same time, and fully portability across major Java deployment environments.

Next, we want to support the latest standards in the web API world, including HTTP/2.0, HTML 5 Server-Sent Events, OAuth 2.0 and JWT, while removing older and less used extensions and capabilities.

Also, we want to support additional editions to facilitate the deployment of Restlet applications and the APISpark management proxy into highly available and scalable container execution environments such as Apache Mesos, Docker Swarm or Google Kubernetes.

Finally, we want to reboot our documentation and improve its quality, with a brand new user guide and more detailed Javadocs, reflecting the latest best practices in term of API-first and code-first development workflows, and eventually write a second edition of the ‘Restlet in Action’ book.

Guillaume: What are some cool or innovative projects and companies you came across that have been using Restlet Framework?

Well, there are many interesting projects that have been built with Restlet Framework. Perhaps to give you a quick taste of what has been made with it, you can have a look at the following case studies that we’ve published online: with RunMyProcess, XWiki, NASA, Apache Solr, Apache Camel, Martello, Ericsson. We’ll publish some more case studies soon, for those curious to discover more use cases for Restlet Framework.

 

Guillaume: Behind Restlet Framework, there’s a company called Restlet. What is Restlet offering? How can Restlet Framework users take advantage of the products offered by the company?

Jérôme: Restlet offers a comprehensive API-first development platform that complements the Restlet Framework with three other products.

1) Restlet Studio is a visual web API IDE that facilitate the crafting of REST API and the generation of Swagger or RAML descriptors. It is also capable of generating client SDKs for several client environments (Android, Java, Objective-C, Angular.js and Node.js) and server skeletons (JAX-RS API, Restlet API and Node.js). It is also capable of translating API descriptors between several API language formats (Swagger 1.2 / 2.0 and RAML 0.8).

2) DHC is an API testing tool that available as a web app and a Chrome app and can be used during the development of Restlet Framework application and will soon provide automated testing capabilities as well via a Maven plugin.

3) APISpark is an API PaaS that can be used to document web APIs and share them among team members or with partners. It can also manage a Restlet Framework application by providing an API proxy configurable via the APISpark web console (the traffic can go either through APISpark infrastructure or directly to the managed API). A dedicated extension is provided in the framework, including the API proxy and an Introspector tool that can automatically extract the structural information of an API written using Restlet Framework.

Guillaume: Thank you Jérôme for this very interesting discussion and insightful answers. Is there anything you else you wish to share with our readers?

Jérôme: We are constantly looking for feedback on the Restlet Framework and especially on the road map for version 3.0 and how it would be best integrated with the rest of our platform and other useful tools in the web API and Java ecosystems.

I’ll be speaking at the APIdays conference in Paris in December and look forward to meeting you and discussing how we at Restlet can help you be successful with your web API projects.


Viewing all articles
Browse latest Browse all 83

Trending Articles