Your SlideShare is downloading. ×

From Open Source to Open API with Restlet

1,535

Published on

JavaZone presentation; 09/13/2012. Thierry Boileau

JavaZone presentation; 09/13/2012. Thierry Boileau

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,535
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. FROM OPEN SOURCE TO OPEN APIS WITH RESTLET JavaZone – September 13th, 2012
  • 2. Copyright Restlet SAS – All rights reserved SPEAKER Thierry Boileau – PolyTech’Montpellier engineer – 14 years of experience in IT service industry and software – Co-founder & community manager at Restlet SAS – Co-author of « Restlet in Action » (Manning, Sept. 2012) Contact: – tboileau@restlet.com – Blog : blog.restlet.com
  • 3. Copyright Restlet SAS – All rights reserved ABSTRACT 1. Are Open APIs more important than Open Source? (20 mn) 2. Web APIs, ecosystem and key actors (10 mn) 3. Restlet Framework 2.1 and roadmap (20 mn) 4. APISpark, all-in-one PaaS for Web APIs (5 mn)
  • 4. ARE OPEN APIS MORE IMPORTANT THAN OPEN SOURCE ? Part 1/4
  • 5. Copyright Restlet SAS – All rights reserved NUMBER OF PUBLIC APIS A STEEP INCREASE ! Source: ProgrammableWeb
  • 6. Copyright Restlet SAS – All rights reserved WHAT ABOUT PRIVATE APIS? Source: ProgrammableWeb
  • 7. Copyright Restlet SAS – All rights reserved NUMBER OF WEB SITES LET’S COMPARE AND DREAM ! Source: NetCraft / Jacob Nielsen
  • 8. Copyright Restlet SAS – All rights reserved REST AT THE FOUNDATION OF WEB APIS NOT FULLY EXPLOITED Source: ProgrammableWeb • REST is often thought as non-SOAP… • But hypermedia is hardly exploited… • AtomPub is more or less the most RESTful API today • REST is not crucial to make your API a success • REST as a guide for higher quality APIs, and standardization
  • 9. Copyright Restlet SAS – All rights reserved LET’S CONSUME OPEN APIS • Enrich a web site (mashups, blogs/tweets streams, Google Maps) • Export/import SaaS (free data, change provider) • SaaS integration (notify/web hooks, automate/workflow) • Composite APIs (combine several APIs in one another)
  • 10. Copyright Restlet SAS – All rights reserved A WEB API EXPOSES… • Mobile backend (connected, native, HTML5 apps) • SaaS backend (HTML5/AJAX, developer/partner API) • Open data backend (multi-formats, developer API, big data) • Internet of Things (M2M, RFID, geo-localization)
  • 11. Copyright Restlet SAS – All rights reserved OPEN SOURCE IMPACT • Cost reduction (licences) • Innovation ecosystem (software) 2000 2005
  • 12. Copyright Restlet SAS – All rights reserved FROM THE OPEN SOURCE TO THE OPEN APIS • Cost reduction (cloud computing) • Cross-canal access (mobility, convergence) 2005 2010
  • 13. Copyright Restlet SAS – All rights reserved IMPACT OF THE OPEN APIS • Cost reduction (composition of web APIs, open and private, time reduction) • Innovation ecosystem (Web APIs markets, new chains of value) 2015 2020
  • 14. Copyright Restlet SAS – All rights reserved INSIDE AN API • Standard Web API contract (ease concurrency) • Sample contracts (Atom/AtomPub, AWS S3, CDMI, etc.) Contract Provider #1 Provider #2 API #1 API #2
  • 15. WEB APIS ECOSYSTEM, KEY ACTORS Part 2/4
  • 16. Copyright Restlet SAS – All rights reserved TWITTER AND THE WEB APIS
  • 17. Copyright Restlet SAS – All rights reserved TWILIO : THE WEB API IS THE PRODUCT
  • 18. Copyright Restlet SAS – All rights reserved GOOGLE MAPS IMAGE API http://maps.googleapis.com/maps/api/staticmap? center=Brooklyn+Bridge,New+York,NY& zoom=14& size=512x512& maptype=roadmap& markers=color:blue%7Clabel:S%7C40.702147,- 74.015794& markers=color:green%7Clabel:G%7C40.711614,- 74.012318& markers=color:red%7Ccolor:red%7C label:C%7C40.718217,-73.998284& sensor=false • « image/png » representation of the map resource • A REST resource can expose binary representations
  • 19. Copyright Restlet SAS – All rights reserved AMAZON WEB SERVICES AND WEB APIS • « exotic » authentication • Non RESTful API • But AWS is a reference in the cloud!
  • 20. Copyright Restlet SAS – All rights reserved NEW ACTORS • RESTful frameworks • Doc generation • NIO/HTTP frameworks • Backend as a Service • Mobile apps • SaaS & Rich web sites • Open Data • Internet of Things • Security • Analytics • Client SDKs • Community management • Catalog • Monetization • Promotion • Referencing • Oracle Jersey • JBoss RESTEasy • XINS, Swagger • Enunciate • Restlet Framework • StackMob • Parse.com • Sencha.io • FireBase • APISpark • Apigee • Mashery • 3Scale • WebServius • APISpark • Programmable Web • Mashape • Alcatel Open API Platform • The easy API • APISpark Dedicated frameworks Creation and hosting Manage Market places
  • 21. RESTLET FRAMEWORK 2.1 AND ROADMAP Part 3/4
  • 22. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK OPEN SOURCE PROJECT CREATED IN 2005 A N D R O I D G A E G W T J A V A E EJ A V A S E Java Language O S G I Framework to expose and consume RESTful web APIs
  • 23. Copyright Restlet SAS – All rights reserved SOME REFERENCES THOUSAND OF USERS, BIG AND SMALL
  • 24. Copyright Restlet SAS – All rights reserved ARCHITECTURE ONE JAVA API, ONE ENGINE, 37 EXTENSIONS!
  • 25. Copyright Restlet SAS – All rights reserved MULTI-PROTOCOLS BUT, CENTERED ON HTTP!
  • 26. Copyright Restlet SAS – All rights reserved MULTI-CLOUD INCREASE THE PORTABILITY OF YOUR WEB APIS AND APPLICATIONS
  • 27. Copyright Restlet SAS – All rights reserved SUPPORT OF GOOGLE SDC SECURE ACCESS TO YOUR INTRANET FROM THE PUBLIC CLOUD
  • 28. Copyright Restlet SAS – All rights reserved MULTI-ECOSYSTEM DEEPLY ROOTED IN JAVA
  • 29. Copyright Restlet SAS – All rights reserved MULTI DISTRIBUTION
  • 30. Copyright Restlet SAS – All rights reserved REST: A PARADIGM
  • 31. Copyright Restlet SAS – All rights reserved COMPETITION 1/2 SEVERAL VISIONS OF THE WEB… HTTP toolkits WS-* frameworks OO web frameworks MVC web frameworks RESTful web framework Wicket, Tapestry Axis, CXF, XINS Spring MVC, Play! Servlet, Apache HTTP Client, Netty, etc.
  • 32. Copyright Restlet SAS – All rights reserved COMPETITION 2/2 USE THE RIGHT PARADIGM ! Focus JAX-RS Focus MVCFocus RPC
  • 33. RESTLET API VS JAX-RS API Part 2-1/4
  • 34. Copyright Restlet SAS – All rights reserved RESTLET API PACKAGES COMPLETE CORE AND STILL COMPACT org.restlet.data org.restlet.representation org.restlet org.restlet.resource org.restlet.routing org.restlet.security org.restlet.service org.restlet.util
  • 35. Copyright Restlet SAS – Tous droits réservés COMPLETE JAVA API USABLE AS A LIBRARY OR AS A FRAMEWORK
  • 36. Copyright Restlet SAS – All rights reserved FILTER AND ROUTING MULTI-THREADED AND DYNAMIC Next Restlet Filter B C A Router B C A Route 1 Route 2 Route 3 A B C
  • 37. Copyright Restlet SAS – All rights reserved ANNOTATED INTERFACES UNIFY BOTH CLIENT AND SERVER CODE public interface RootResource { @Get("txt") public String represent(); } public interface AccountsResource { @Get("txt|json|xml") public String represent(); @Post("txt") public String add(String account); } public interface AccountResource { @Get("txt?depth={level}") public String represent(); @Put(“form:txt") public void store(String account); @Delete public void remove(); }
  • 38. Copyright Restlet SAS – All rights reserved CONVERSION SERVICE EXTENSIBLE, SCORING, REPRESENTATION BEANS Resource XML HTML JSON State Representation bean Form Data RDF … Atom Converter service
  • 39. Copyright Restlet SAS – Tous droits réservés CLIENT AND SERVEUR MULTI-LEVEL API
  • 40. Copyright Restlet SAS – Tous droits réservés RESTLET API 2.1 VS JAX-RS 2.0
  • 41. Copyright Restlet SAS – All rights reserved COMPARING JAVA APIS 1/2 Feature Restlet API 2.1 JAX-RS API 2.0 Java API style Centered on Resource and based on inheritance Centered on POJO and annotations Number of annotations 5 24 Supported HTTP headers 50 26 Minimum version Java SE 5.0 Java SE 6.0 Alignment on HTTP and REST Complete, almost Partial Security Yes No Routing (filters and routers) Yes Limited Components and connectors Yes No Static files Yes No
  • 42. Copyright Restlet SAS – All rights reserved COMPARING JAVA APIS 2/2 Characteristic API Restlet 2.1 API JAX-RS 2.0 Reverse proxy Yes No Asynchronous representations Yes No Streaming HTTP Complete Limited Réponses provisionnelles Yes No JCP standard No Yes Ecosystem Open (Google, AWS, Oracle, IBM, MS, etc.) JCP (Oracle, RedHat, OW2, etc.) Age 7 years 5 years Innovation Quick Slower
  • 43. Copyright Restlet SAS – Tous droits réservés DIFFERENT CODING STYLES 1/2 SHOW ME THE CODE! JAX-RS API 2.0 // Get instance of Client Client client = ClientFactory.newClient(); // Get account balance String bal = client.target("http://.../atm/{cardI d}/balance") .pathParam("cardId", "112233") .queryParam("pin", "9876") .request("text/plain").get(String.cl ass); Restlet API 2.1 // Get instance of Client ClientResource client = new ClientResource(""http://.../atm/{cardId} /balance"); // Get account balance client.setPathValue("cardId", "112233"); client.setQueryValue("pin", "9876"); client.accept(MediaType.TXT_PLAIN); String bal = client.get(String.class);
  • 44. Copyright Restlet SAS – Tous droits réservés DIFFERENT CODING STYLES 2/2 SHOW ME THE CODE! JAX-RS API 2.0 @POST @Path(“withdrawal") @Consumes("text/plain") @Produces("application/json") public Money withdraw( @PathParam("card") String card, @QueryParam("pin") String pin, String amount){ return getMoney(card, pin, amount); } Restlet API 2.1 @Post(“txt:json”) public Money withdraw(){ String card = getPathValue(“card”); String pin = getQueryValue(“pin”); String amount = getQueryValue(“amount”); return getMoney(card, pin, amount); }
  • 45. ROADMAP Partie 2-2/4
  • 46. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 2.1 (1/2) 2 YEARS OF WORK ! • Incremental enhancement on the Restlet API – Syntax sugar (getQuery, getPath, etc.) – Enhanced annotations. Example: @Get("form|xml:json?level=2") – Easy logging of individual requests – Client-side ConnegService, DecoderService – Manage lack of chunk encoding on client side for the GAE platform – EMF extension (XMI/XML converter), HTML (multi-part upload) • Enhanced security APIs – Support of AWS S3, AWS Query, Cookie and GAE schemes – Support of Google Secure Data Connector (SDC) outside GAE – New OAuth 2.0 and OpenID 2.0 extensions (draft specs) • New internal HTTP connector – Non blocking NIO design, few threads – Zero dependency, centered HTTP/Restlet, asynchronous representation read – extensible (SIP extension)
  • 47. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 2.1 (2/2) RELEASED IN SEPTEMBER 2012 • « Restlet in Action » book – Paper version synchronised with version 2.1.0 • Option « Apache Public License 2.0 » – In addition to EPL 1.0, LGPL 2.1/3.0 et CDDL 1.0 – Commerciales licences available if necessary • Migration to GitHub – SVN history with branches imported – Import of Tigris.org issues – Increased the number of contributions !
  • 48. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 2.2 (1/2) LISTEN TO THE COMMUNITY • Migration to Google Groups – Discussion lists for users and developers still on Tigris.org • Migration to StackOverflow – Already used for simple questions and bugs – Increase the quality of exchanges on the list • Migration to Java SE 6 – Java SE 5 supported since Restlet Framework 1.0 ! – Reduce the size of the code (ex: service pattern)
  • 49. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 2.2 (2/2) INCREMENTAL ENHANCEMENT • Incremental enhancement – Optimize the size of Android and GWT editions – CacheService : extensible and generic – OSGi edition : fully dynamic management – Injection : Guice, Spring (enhancement) • Native JavaScript port – Same abstraction level as Java – Client side (browser/XHR and Node.JS) – Server side (Node.JS) – Prototype already available!
  • 50. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 3.0 (1/2) FROM A FRAMEWORK TO A PLATFORM APISpark Closed source Open source APIsweb simples Cloud Sophisticated Web APIs Clients usages Apps Framework Forge Studio Restlet Platform Export
  • 51. Copyright Restlet SAS – All rights reserved RESTLET FRAMEWORK 3.0 (2/2) MAIN DIRECTIONS • Web site : new design and tutorial • Restlet Studio : IDE based on Eclipse 4.0 • Restlet Apps : Search application • Internal connector – Unify client and server runtime – Unique threads pool (via TaskService) – SPDY support (on NIO) • Internal converter – Support of multi-formats (XML, JSON, RDF, Form, CSV, etc.) – Support of hyperlinks and HTTP metadata • New Port : Google Dart • Support HTML 5 : Server-Sent Events, Cross-Origin policies
  • 52. APISPARK, RESTLET AS A SERVICE Partie 4/4
  • 53. Copyright Restlet SAS – All rights reserved OFFER PRESENTATION 1/2 All-in-one platform for Web APIs • Create your Web API quickly – 5 minutes scenario based on existing API template (e.g. blog API) – Few hours scenario from scratch or by customizing an existing API template (from the APIs catalog) – Open source foundation (Restlet Framework) , the full code can be exported • Integrated hosting – Scalable and reactive backend (low latency, integrated management) – Permanent availability 4/24h et 7/7d (no maintenance window) and securized (SSL confidentiality, precise management of autorisations) • Automatic releasing – Manage several versions of your APIs at the same time at the same cost – Free to update your APIs with no impact on current users – Simple and clear lifecycle (draft, published, deprecated, archived, removed)
  • 54. Copyright Restlet SAS – All rights reserved All-in-one platform for Web APIs • Automatic documentation – Always up-to-date – Test your API live on the Net – Easy export in PDF and HTML • Clients kits generation – Ease the use of your API – Support of most popular platforms (iPhone/iPad, Android, Java, .NET, PHP, Python) • Community management – Manage the users and their signins – Private or public communities – Send publics announcements or private messages – Integration with social networks OFFRE PRESENTATION 2/2
  • 55. Copyright Restlet SAS – All rights reserved 1. Backends for connected Mobile applications – native or HTML 5 2. Backend for SaaS solution – HTML 5/AJAX, API developer/partner 3. Backend for connected objects – Perso or Pro, M2M, RFID, GPS, 3G, geoloc. 4. Backend for Open Data – Multi-formats, API developer, Big Data USE CASES
  • 56. Copyright Restlet SAS – All rights reserved CATALOG OF APIS
  • 57. Copyright Restlet SAS – All rights reserved DESIGN YOUR WEB API
  • 58. Copyright Restlet SAS – All rights reserved ANALYTICS
  • 59. Copyright Restlet SAS – All rights reserved • Private Beta : April 2012 • Public Beta : October 2012 • Version 1.0 : Last quarter 2012 • Join-us ! http://apispark.com ROADMAP
  • 60. Copyright Restlet SAS – All rights reserved CONCLUSION WHY RESTLET ? • Learning REST and HTTP is a long term investment – it takes time, as for object-oriented – first benefits easy to obtain – be pragmatic for the rest • Web APIs give opportunities – exposition (server side) & consuming (client side) – APIs mashups, cloud workflows • Restlet Framework – Powerful open source solution • APISpark – Simple, all-in-one on-line solution
  • 61. THANKS!

×