SlideShare a Scribd company logo
The Glory of REST
NEW TOOLS TO IMPROVE REST MATURITY
Agenda
Introduction
Spring HATEOAS
◦ R 0.5 in May 2013, included in Spring-WebMVC 4.0
RAML
◦ RESTful API Modeling Language
◦ From Mulesoft
IRIS
◦ Temenos Interaction, Reporting & Information Services
Introduction: REST
REST: Representational State Transfer
“Architectural Styles and the Design of Network-based Software Architectures”
◦ Doctorate Dissertation of Roy T, Fielding, 2000
◦ “Why does the internet work so well?”
4 Interface constraints for a modern Web architecture
◦ identification of resources
◦ manipulation of resources through representations
◦ self-descriptive messages
◦ hypermedia as the engine of application state.
REST Architecture
REST Maturity Model (Leonard Richardson)
REST Maturity
Spring-REST MVC enables Level 2 Maturity
◦Resource URL’s, HTTP Verbs, Status Codes
◦Media type negotiation
Level 3 Maturity: Hypermedia Controls
◦Documents are Self-describing
◦ Describes possible interactions via e.g. links
◦HATEOAS: Hypermedia as the Engine of Application State
Spring HATEOAS
◦Provides support for generic links in Spring-RestMVC
◦Hard-code URI’s
◦Dynamic URI’s linking to Controllers
Basis for Spring Data REST
◦Converts Data repositories directly into REST Controllers
◦Links for CRUD operations
Will be included in Spring WebMVC
Spring HATEOAS Example
@Controller
class EngineController {
@RequestMapping("/engine")
HttpEntity<Resource<Order>> showOrderInProgress() {
Resource<Order> resource = Resources.wrap(order);
resource.add(
linkTo(methodOn(EngineController.class).showOrdersInProgress()).withSelfRel());
resource.add(
entityLinks.linkForSingleResource(order).slash(payment).withRel(payment));
return new ResponseEntity<>(orderResources, HttpStatus.OK);
}
Spring HATEOAS Example(2)
@Controller
@RequestMapping("/orders/{id}")
@ExposesResourceFor(Payment.class)
public class PaymentController {
@RequestMapping(value = “/payment”, method = RequestMethod.PUT)
ResponseEntity<PaymentResource> submitPayment(@PathVariable("id") Order order,
@RequestBody CreditCardNumber number) {
if (order == null || order.isPaid()) {
return new ResponseEntity<PaymentResource>(HttpStatus.NOT_FOUND);
}
CreditCardPayment payment = paymentService.pay(order, number);
PaymentResource resource = new PaymentResource(order.getPrice(),
payment.getCreditCard());
resource.add(entityLinks.linkToSingleResource(order));
return new ResponseEntity<PaymentResource>(resource, HttpStatus.CREATED);
}
Spring HATEOAS Conclusion
Allows to create links.
Integrates in Spring REST MVC
First step to hypermedia control
RAML: RESTful API Modeling Language
Description language for RESTful API
◦ Resources
◦ Methods
◦ Parameters
◦ Responses
Both human readable and machine readable
◦ YAML based
◦ Focuses on description
◦ Not strict: no validation, can use JSON Schema, XSD, simple example or just plain text description
Reusable resource types and traits
Design tools by MuleSoft
RAML Example#%RAML 0.8
---
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
/songs:
get:
queryParameters:
genre:
description: filter the songs by genre
/{songId}:
get:
body:
application/json:
schema: |
{ "$schema": "http://json-schema.org/schema",
"type": "object", "description": "The canonical song representation",
"properties": {
"title": { "type": "string" },
"artist": { "type": "string" }
}
"required": [ "title", "artist" ]
}
delete:
description: This method will *delete* an **individual song**
RAML
Traits: reusable (partial) method definitions
traits:
- paged:
queryParameters:
limit:
type: number
skip:
type: number
ResourceTypes: reusable (partial) resource definitions
◦ Method API definitions
◦ Nested URI’s
Schema language is not restricted
◦ JSON Hyper-schema could be used, no special treatment
JSON Schema and JSON Hyper-Schema
JSON Schema: XSD for JSON
◦ IETF Draft
◦ Example
{
"title": "Example Schema",
"type": "object",
"properties": {
"firstName": {"type": "string"},
"lastName": { "type": "string"},
"age": {"description": "Age in years","type": "integer","minimum": 0}
},
"required": ["firstName", "lastName"]
}
JSON Hyper-Schema
◦ JSON Schema + standard schema for hypermedia properties
◦ Links, schema for submission links, URI templates
IRIS
Temenos Interaction, Reporting & Information Services
● Open sourced by Temenos Tech
◦ ○ https://github.com/temenostech
◦ ○ Origin: Dynamic Client for insurance brokers
◦ ○ Forms generated by metadata
● RIM: Resource Interaction Model
◦ ○ Based on HAL: Hypertext Application Language
◦ ○ Links, transitions, workflow
● Full Level 3 Maturity
◦ ○ Hypermedia Controls
Very little documentation
HAL: Hypertext Application Language
Links and embedded resources in JSON or XML
Separate media type: application/hal+json
"_links": {
"self": { "href": "/product/987" },
"upsell": [
{ "href": "/product/452", "title": "Flower pot" },
{ "href": "/product/832", "title": "Hover donkey" }
]
},
"_embedded": {
"manufacturer": {
"_links": {"self": { "href": "/manufacturers/328764" } },
"name": "Manufacturer Inc.“
…
},
…
Generic HAL Browser, see e.g. http://haltalk.herokuapp.com/explorer/browser.html#/
Further Reading
REST Maturity Model: http://martinfowler.com/articles/richardsonMaturityModel.html
● Spring HATEOAS http://projects.spring.io/spring-hateoas/
● JSON Schema: http://json-schema.org/
● RAML: http://raml.org/
● HAL – Hypertext Application Language: http://stateless.co/hal_specification.html
● IRIS: https://github.com/temenostech/IRIS

More Related Content

What's hot

REST API Design
REST API DesignREST API Design
REST API Design
Devi Kiran G
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
Robert Wilson
 
Designing REST services with Spring MVC
Designing REST services with Spring MVCDesigning REST services with Spring MVC
Designing REST services with Spring MVC
Serhii Kartashov
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service design
Ramin Orujov
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transferTricode (part of Dept)
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
Dong Ngoc
 
Rest web services
Rest web servicesRest web services
Rest web services
Paulo Gandra de Sousa
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
L18 REST API Design
L18 REST API DesignL18 REST API Design
L18 REST API Design
Ólafur Andri Ragnarsson
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
Alexandros Marinos
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
digitalsonic
 
RESTful API Design Fundamentals
RESTful API Design FundamentalsRESTful API Design Fundamentals
RESTful API Design Fundamentals
Hüseyin BABAL
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
Prateek Tandon
 
Resource Oriented Architectures
Resource Oriented ArchitecturesResource Oriented Architectures
Resource Oriented ArchitecturesGabriele Lana
 
Hypermedia APIs
Hypermedia APIsHypermedia APIs
Hypermedia APIs
Paulo Gandra de Sousa
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 

What's hot (20)

REST API Design
REST API DesignREST API Design
REST API Design
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
 
Designing REST services with Spring MVC
Designing REST services with Spring MVCDesigning REST services with Spring MVC
Designing REST services with Spring MVC
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service design
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
L18 REST API Design
L18 REST API DesignL18 REST API Design
L18 REST API Design
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
 
RESTful API Design Fundamentals
RESTful API Design FundamentalsRESTful API Design Fundamentals
RESTful API Design Fundamentals
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Resource Oriented Architectures
Resource Oriented ArchitecturesResource Oriented Architectures
Resource Oriented Architectures
 
Hypermedia APIs
Hypermedia APIsHypermedia APIs
Hypermedia APIs
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 

Similar to The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS

The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
Sławomir Chrobak
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable links
Stephen Richard
 
RAML
RAMLRAML
Rest web service
Rest web serviceRest web service
Rest web service
Hamid Ghorbani
 
Introduction to Hydra
Introduction to HydraIntroduction to Hydra
Introduction to Hydra
Alejandro Inestal
 
Automating the Use of Web APIs through Lightweight Semantics
Automating the Use of Web APIs through Lightweight SemanticsAutomating the Use of Web APIs through Lightweight Semantics
Automating the Use of Web APIs through Lightweight Semantics
mmaleshkova
 
Rest introduction
Rest introductionRest introduction
Rest introduction
William Martinez Pomares
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsRinke Hoekstra
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Hypermedia APIs and HATEOAS / Wix Engineering
Hypermedia APIs and HATEOAS / Wix EngineeringHypermedia APIs and HATEOAS / Wix Engineering
Hypermedia APIs and HATEOAS / Wix Engineering
Vladimir Tsukur
 
Linked services
Linked servicesLinked services
Linked services
Carlos Pedrinaci
 
Raml mtljs-20150609
Raml mtljs-20150609Raml mtljs-20150609
Raml mtljs-20150609
Jonathan Stoikovitch
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
David Gómez García
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
Codemotion
 
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIsPoster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Ruben Taelman
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
Michael Koster
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
Dan Brickley
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworksbrendonschwartz
 

Similar to The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS (20)

The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable links
 
RAML
RAMLRAML
RAML
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Introduction to Hydra
Introduction to HydraIntroduction to Hydra
Introduction to Hydra
 
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
Hacia la Internet del Futuro: Web Semántica y Open Linked Data, Parte 2
 
Automating the Use of Web APIs through Lightweight Semantics
Automating the Use of Web APIs through Lightweight SemanticsAutomating the Use of Web APIs through Lightweight Semantics
Automating the Use of Web APIs through Lightweight Semantics
 
Rest introduction
Rest introductionRest introduction
Rest introduction
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n Bolts
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
 
Hypermedia APIs and HATEOAS / Wix Engineering
Hypermedia APIs and HATEOAS / Wix EngineeringHypermedia APIs and HATEOAS / Wix Engineering
Hypermedia APIs and HATEOAS / Wix Engineering
 
Linked services
Linked servicesLinked services
Linked services
 
Raml mtljs-20150609
Raml mtljs-20150609Raml mtljs-20150609
Raml mtljs-20150609
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIsPoster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
 
Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
 

More from Geert Pante

OAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring BootOAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring Boot
Geert Pante
 
Kafka Introduction.pptx
Kafka Introduction.pptxKafka Introduction.pptx
Kafka Introduction.pptx
Geert Pante
 
Kubernetes and Amazon ECS
Kubernetes and Amazon ECSKubernetes and Amazon ECS
Kubernetes and Amazon ECS
Geert Pante
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
Geert Pante
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
Geert Pante
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
Geert Pante
 
Java EE 6
Java EE 6Java EE 6
Java EE 6
Geert Pante
 
Spring 4 en spring data
Spring 4 en spring dataSpring 4 en spring data
Spring 4 en spring data
Geert Pante
 
Spring and SOA (2006)
Spring and SOA (2006)Spring and SOA (2006)
Spring and SOA (2006)
Geert Pante
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
Geert Pante
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in MavenGeert Pante
 

More from Geert Pante (11)

OAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring BootOAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring Boot
 
Kafka Introduction.pptx
Kafka Introduction.pptxKafka Introduction.pptx
Kafka Introduction.pptx
 
Kubernetes and Amazon ECS
Kubernetes and Amazon ECSKubernetes and Amazon ECS
Kubernetes and Amazon ECS
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
 
Java EE 6
Java EE 6Java EE 6
Java EE 6
 
Spring 4 en spring data
Spring 4 en spring dataSpring 4 en spring data
Spring 4 en spring data
 
Spring and SOA (2006)
Spring and SOA (2006)Spring and SOA (2006)
Spring and SOA (2006)
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
 

Recently uploaded

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS

  • 1. The Glory of REST NEW TOOLS TO IMPROVE REST MATURITY
  • 2. Agenda Introduction Spring HATEOAS ◦ R 0.5 in May 2013, included in Spring-WebMVC 4.0 RAML ◦ RESTful API Modeling Language ◦ From Mulesoft IRIS ◦ Temenos Interaction, Reporting & Information Services
  • 3. Introduction: REST REST: Representational State Transfer “Architectural Styles and the Design of Network-based Software Architectures” ◦ Doctorate Dissertation of Roy T, Fielding, 2000 ◦ “Why does the internet work so well?” 4 Interface constraints for a modern Web architecture ◦ identification of resources ◦ manipulation of resources through representations ◦ self-descriptive messages ◦ hypermedia as the engine of application state.
  • 5. REST Maturity Model (Leonard Richardson)
  • 6. REST Maturity Spring-REST MVC enables Level 2 Maturity ◦Resource URL’s, HTTP Verbs, Status Codes ◦Media type negotiation Level 3 Maturity: Hypermedia Controls ◦Documents are Self-describing ◦ Describes possible interactions via e.g. links ◦HATEOAS: Hypermedia as the Engine of Application State
  • 7. Spring HATEOAS ◦Provides support for generic links in Spring-RestMVC ◦Hard-code URI’s ◦Dynamic URI’s linking to Controllers Basis for Spring Data REST ◦Converts Data repositories directly into REST Controllers ◦Links for CRUD operations Will be included in Spring WebMVC
  • 8. Spring HATEOAS Example @Controller class EngineController { @RequestMapping("/engine") HttpEntity<Resource<Order>> showOrderInProgress() { Resource<Order> resource = Resources.wrap(order); resource.add( linkTo(methodOn(EngineController.class).showOrdersInProgress()).withSelfRel()); resource.add( entityLinks.linkForSingleResource(order).slash(payment).withRel(payment)); return new ResponseEntity<>(orderResources, HttpStatus.OK); }
  • 9. Spring HATEOAS Example(2) @Controller @RequestMapping("/orders/{id}") @ExposesResourceFor(Payment.class) public class PaymentController { @RequestMapping(value = “/payment”, method = RequestMethod.PUT) ResponseEntity<PaymentResource> submitPayment(@PathVariable("id") Order order, @RequestBody CreditCardNumber number) { if (order == null || order.isPaid()) { return new ResponseEntity<PaymentResource>(HttpStatus.NOT_FOUND); } CreditCardPayment payment = paymentService.pay(order, number); PaymentResource resource = new PaymentResource(order.getPrice(), payment.getCreditCard()); resource.add(entityLinks.linkToSingleResource(order)); return new ResponseEntity<PaymentResource>(resource, HttpStatus.CREATED); }
  • 10. Spring HATEOAS Conclusion Allows to create links. Integrates in Spring REST MVC First step to hypermedia control
  • 11. RAML: RESTful API Modeling Language Description language for RESTful API ◦ Resources ◦ Methods ◦ Parameters ◦ Responses Both human readable and machine readable ◦ YAML based ◦ Focuses on description ◦ Not strict: no validation, can use JSON Schema, XSD, simple example or just plain text description Reusable resource types and traits Design tools by MuleSoft
  • 12. RAML Example#%RAML 0.8 --- title: World Music API baseUri: http://example.api.com/{version} version: v1 /songs: get: queryParameters: genre: description: filter the songs by genre /{songId}: get: body: application/json: schema: | { "$schema": "http://json-schema.org/schema", "type": "object", "description": "The canonical song representation", "properties": { "title": { "type": "string" }, "artist": { "type": "string" } } "required": [ "title", "artist" ] } delete: description: This method will *delete* an **individual song**
  • 13. RAML Traits: reusable (partial) method definitions traits: - paged: queryParameters: limit: type: number skip: type: number ResourceTypes: reusable (partial) resource definitions ◦ Method API definitions ◦ Nested URI’s Schema language is not restricted ◦ JSON Hyper-schema could be used, no special treatment
  • 14. JSON Schema and JSON Hyper-Schema JSON Schema: XSD for JSON ◦ IETF Draft ◦ Example { "title": "Example Schema", "type": "object", "properties": { "firstName": {"type": "string"}, "lastName": { "type": "string"}, "age": {"description": "Age in years","type": "integer","minimum": 0} }, "required": ["firstName", "lastName"] } JSON Hyper-Schema ◦ JSON Schema + standard schema for hypermedia properties ◦ Links, schema for submission links, URI templates
  • 15. IRIS Temenos Interaction, Reporting & Information Services ● Open sourced by Temenos Tech ◦ ○ https://github.com/temenostech ◦ ○ Origin: Dynamic Client for insurance brokers ◦ ○ Forms generated by metadata ● RIM: Resource Interaction Model ◦ ○ Based on HAL: Hypertext Application Language ◦ ○ Links, transitions, workflow ● Full Level 3 Maturity ◦ ○ Hypermedia Controls Very little documentation
  • 16. HAL: Hypertext Application Language Links and embedded resources in JSON or XML Separate media type: application/hal+json "_links": { "self": { "href": "/product/987" }, "upsell": [ { "href": "/product/452", "title": "Flower pot" }, { "href": "/product/832", "title": "Hover donkey" } ] }, "_embedded": { "manufacturer": { "_links": {"self": { "href": "/manufacturers/328764" } }, "name": "Manufacturer Inc.“ … }, … Generic HAL Browser, see e.g. http://haltalk.herokuapp.com/explorer/browser.html#/
  • 17. Further Reading REST Maturity Model: http://martinfowler.com/articles/richardsonMaturityModel.html ● Spring HATEOAS http://projects.spring.io/spring-hateoas/ ● JSON Schema: http://json-schema.org/ ● RAML: http://raml.org/ ● HAL – Hypertext Application Language: http://stateless.co/hal_specification.html ● IRIS: https://github.com/temenostech/IRIS