SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
RESTful HATEOAS
standards using
Java based
Katharsis
Keith D. Moore
• Independent Software Consultant
• KD Moore Consulting
• http://www.kdmooreconsulting.com
• keith@kdmooreconsulting.com
• @keithdmoore94
• in/keithdmoore94
What is a RESTful API?
An application program interface (API) that uses HTTP
methods like GET, POST, PUT, PATCH, OPTIONS and
DELETE to make requests and receive responses.
HTTP Methods for REST
• GET - this is a read method (get all/get one)
• POST - this is a create method
• PUT - this is an update method (usually a full replacement)
• PATCH - this is an update method (usually partial)
• OPTIONS - typically used for preflight requests or metadata
• DELETE - this a delete method
HATEOAS
• (Hypermedia as the Engine of Application State) is a constraint
of the REST application architecture. A hypermedia-driven site
provides information to navigate the site's REST interfaces
dynamically by including hypermedia links with the responses.
• Allows a client to navigate a set of resources with very little
documentation.
• Allows for resource urls to change without impacting the client.
• Essentially provides the ability to create a self-describing API
Parkinson's law of triviality is C.
Northcote Parkinson's 1957
argument that members of an
organization give disproportionate
weight to trivial issues. He observed
that a committee whose job was to
approve the plans for a nuclear
power plant spent the majority of its
time on discussions about relatively
minor but easy-to-grasp issues,
such as what materials to use for the
staff bike-shed, while neglecting the
proposed design of the plant itself,
which is far more important but also
a far more difficult and complex task.
The Bikeshed moment
• How are the requests/responses going to be formatted?
• Are we going to use a PATCH method for full and partial
updates?
• What is the format for a pagination or sorting request?
• How will requests be structured that act on resource
relationships?
• How will error responses be formatted?
JSON API to the rescue
• JSON API is a specification for how a client should request that resources be
fetched or modified, and how a server should respond to those requests.
• http://jsonapi.org (there really is a specification for it)
• Even has its own media type: application/vnd.api+json
• Lots of MUST, MUST NOT, SHOULD, MAY, etc.
• There are still some decisions to be made but this gives you a framework to make
some of the more fine grained decisions.
• Several implementations in a variety of languages. Both client-side and server-side.
REST URI’s
	•	GET /api/tasks: returns all tasks
	•	GET /api/tasks/1: returns the task with ID 1
	•	POST /api/tasks: creates a task with the data sent in
the body
	•	PATCH /api/tasks/1: updates the task with ID 1 with
the data sent in the body (only send what you want to
update)
	•	DELETE /api/tasks/1: delete the task with ID 1
	•	OPTIONS /api/tasks: metadata about the member
resource
Sample Response
{
"data": {
"type": "articles",
"id": "1",
"attributes": {
“title”: “Having fun with JSON”,
“description”: “Explore the fun you can have with JSON.”
},
"relationships": {
"author": {
"links": {
"self": "/articles/1/relationships/author",
"related": “/articles/1/author"
}
}
}
}
}
atharsis
• a Greek word meaning "cleansing" or “purging”
• Elegant and powerful HATEOAS framework for Java based on the
JSON API standard
• Uses ResourceRepository and ResourceRelationshipRepository
• Annotation based or interface based
• Modular
• Core
• Spring
• JAX-RS
• Servlet
• Vertx
• Examples
• Very few dependencies
Let’s look at Katharsis in Action
Filter/Sort/Group/Pagination
• GET /api/tasks?filter[tasks][name]=Make%20Coffee
• GET /api/tasks?sort[tasks][name]=asc
• GET /api/tasks?group[tasks]=name
• GET /api/tasks?include[tasks]=project
• GET /api/tasks?page[offset]=0&page[limit]=10
Pagination using Links
"links": {
"self": “http://example.com/articles/22“,
"first": “http://example.com/articles?page[offset]=0”
"prev": “http://example.com/articles?page[offset]=1”
"next": "http://example.com/articles?page[offset]=3",
"last": "http://example.com/articles?page[offset]=10"
}
References and Links
• http://jsonapi.org
• https://en.wikipedia.org/wiki/HATEOAS
• http://katharsis.io
• https://en.wikipedia.org/wiki/Law_of_triviality

Mais conteúdo relacionado

Mais procurados

Best Practices for RESTful Web Services
Best Practices for RESTful Web ServicesBest Practices for RESTful Web Services
Best Practices for RESTful Web ServicesSalesforce Developers
 
Test in Rest. API testing with the help of Rest Assured.
Test in Rest. API testing with the help of  Rest Assured.Test in Rest. API testing with the help of  Rest Assured.
Test in Rest. API testing with the help of Rest Assured.Artem Korchevyi
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service DesignLorna Mitchell
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoSencha
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionMazenetsolution
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST APIAmilaSilva13
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA psrpatnaik
 
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India
 
Implementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMImplementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMrtpaem
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API4Science
 
Rest api to integrate with your site
Rest api to integrate with your siteRest api to integrate with your site
Rest api to integrate with your siteHoang Nguyen
 
At Begin, URL Handling and REST
At Begin, URL Handling and RESTAt Begin, URL Handling and REST
At Begin, URL Handling and RESTBrian Loomis
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsanthony_putignano
 
Keeping Discovery in the Library
Keeping Discovery in the LibraryKeeping Discovery in the Library
Keeping Discovery in the LibraryKen Varnum
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptxHarry Potter
 

Mais procurados (19)

Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
 
Api crash
Api crashApi crash
Api crash
 
Best Practices for RESTful Web Services
Best Practices for RESTful Web ServicesBest Practices for RESTful Web Services
Best Practices for RESTful Web Services
 
Test in Rest. API testing with the help of Rest Assured.
Test in Rest. API testing with the help of  Rest Assured.Test in Rest. API testing with the help of  Rest Assured.
Test in Rest. API testing with the help of Rest Assured.
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST API
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA
 
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
 
Implementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMImplementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEM
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API
 
Rest api to integrate with your site
Rest api to integrate with your siteRest api to integrate with your site
Rest api to integrate with your site
 
At Begin, URL Handling and REST
At Begin, URL Handling and RESTAt Begin, URL Handling and REST
At Begin, URL Handling and REST
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
 
Rest api and-crud-api
Rest api and-crud-apiRest api and-crud-api
Rest api and-crud-api
 
Keeping Discovery in the Library
Keeping Discovery in the LibraryKeeping Discovery in the Library
Keeping Discovery in the Library
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptx
 

Destaque

RESTful HATEOAS standards using Java based Katharsis
RESTful HATEOAS standards using Java based KatharsisRESTful HATEOAS standards using Java based Katharsis
RESTful HATEOAS standards using Java based KatharsisKeith Moore
 
Gearing up for push notifications
Gearing up for push notificationsGearing up for push notifications
Gearing up for push notificationsKeith Moore
 
Netflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandNetflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandJWORKS powered by Ordina
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounderMarkus Winand
 
Revitalizing Walmart's Aging Architecture for Web Scale
Revitalizing Walmart's Aging Architecture for Web ScaleRevitalizing Walmart's Aging Architecture for Web Scale
Revitalizing Walmart's Aging Architecture for Web ScaleKevin Webber
 
Clean architecture on Android
Clean architecture on AndroidClean architecture on Android
Clean architecture on AndroidGDG Odessa
 
Pagination Done the Right Way
Pagination Done the Right WayPagination Done the Right Way
Pagination Done the Right WayMarkus Winand
 
Reactive Distributed Applications with Vert.x
Reactive Distributed Applications with Vert.xReactive Distributed Applications with Vert.x
Reactive Distributed Applications with Vert.xRed Hat Developers
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
Patterns for building resilient and scalable microservices platform on AWS
Patterns for building resilient and scalable microservices platform on AWSPatterns for building resilient and scalable microservices platform on AWS
Patterns for building resilient and scalable microservices platform on AWSBoyan Dimitrov
 

Destaque (10)

RESTful HATEOAS standards using Java based Katharsis
RESTful HATEOAS standards using Java based KatharsisRESTful HATEOAS standards using Java based Katharsis
RESTful HATEOAS standards using Java based Katharsis
 
Gearing up for push notifications
Gearing up for push notificationsGearing up for push notifications
Gearing up for push notifications
 
Netflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandNetflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLand
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounder
 
Revitalizing Walmart's Aging Architecture for Web Scale
Revitalizing Walmart's Aging Architecture for Web ScaleRevitalizing Walmart's Aging Architecture for Web Scale
Revitalizing Walmart's Aging Architecture for Web Scale
 
Clean architecture on Android
Clean architecture on AndroidClean architecture on Android
Clean architecture on Android
 
Pagination Done the Right Way
Pagination Done the Right WayPagination Done the Right Way
Pagination Done the Right Way
 
Reactive Distributed Applications with Vert.x
Reactive Distributed Applications with Vert.xReactive Distributed Applications with Vert.x
Reactive Distributed Applications with Vert.x
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Patterns for building resilient and scalable microservices platform on AWS
Patterns for building resilient and scalable microservices platform on AWSPatterns for building resilient and scalable microservices platform on AWS
Patterns for building resilient and scalable microservices platform on AWS
 

Semelhante a RESTful HATEOAS standards using Java based Katharsis

Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构Benjamin Tan
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
API testing with the help of Rest Assured
API testing with the help of  Rest Assured API testing with the help of  Rest Assured
API testing with the help of Rest Assured Artem Korchevyi
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with ODataMahek Merchant
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxapidays
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIsSiva Arunachalam
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologiesjrodbx
 

Semelhante a RESTful HATEOAS standards using Java based Katharsis (20)

Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
RESTful Services
RESTful ServicesRESTful Services
RESTful Services
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
API testing with the help of Rest Assured
API testing with the help of  Rest Assured API testing with the help of  Rest Assured
API testing with the help of Rest Assured
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
 

Último

Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Último (20)

Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

RESTful HATEOAS standards using Java based Katharsis

  • 2. Keith D. Moore • Independent Software Consultant • KD Moore Consulting • http://www.kdmooreconsulting.com • keith@kdmooreconsulting.com • @keithdmoore94 • in/keithdmoore94
  • 3. What is a RESTful API? An application program interface (API) that uses HTTP methods like GET, POST, PUT, PATCH, OPTIONS and DELETE to make requests and receive responses.
  • 4. HTTP Methods for REST • GET - this is a read method (get all/get one) • POST - this is a create method • PUT - this is an update method (usually a full replacement) • PATCH - this is an update method (usually partial) • OPTIONS - typically used for preflight requests or metadata • DELETE - this a delete method
  • 5. HATEOAS • (Hypermedia as the Engine of Application State) is a constraint of the REST application architecture. A hypermedia-driven site provides information to navigate the site's REST interfaces dynamically by including hypermedia links with the responses. • Allows a client to navigate a set of resources with very little documentation. • Allows for resource urls to change without impacting the client. • Essentially provides the ability to create a self-describing API
  • 6. Parkinson's law of triviality is C. Northcote Parkinson's 1957 argument that members of an organization give disproportionate weight to trivial issues. He observed that a committee whose job was to approve the plans for a nuclear power plant spent the majority of its time on discussions about relatively minor but easy-to-grasp issues, such as what materials to use for the staff bike-shed, while neglecting the proposed design of the plant itself, which is far more important but also a far more difficult and complex task.
  • 7. The Bikeshed moment • How are the requests/responses going to be formatted? • Are we going to use a PATCH method for full and partial updates? • What is the format for a pagination or sorting request? • How will requests be structured that act on resource relationships? • How will error responses be formatted?
  • 8. JSON API to the rescue • JSON API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. • http://jsonapi.org (there really is a specification for it) • Even has its own media type: application/vnd.api+json • Lots of MUST, MUST NOT, SHOULD, MAY, etc. • There are still some decisions to be made but this gives you a framework to make some of the more fine grained decisions. • Several implementations in a variety of languages. Both client-side and server-side.
  • 9. REST URI’s • GET /api/tasks: returns all tasks • GET /api/tasks/1: returns the task with ID 1 • POST /api/tasks: creates a task with the data sent in the body • PATCH /api/tasks/1: updates the task with ID 1 with the data sent in the body (only send what you want to update) • DELETE /api/tasks/1: delete the task with ID 1 • OPTIONS /api/tasks: metadata about the member resource
  • 10. Sample Response { "data": { "type": "articles", "id": "1", "attributes": { “title”: “Having fun with JSON”, “description”: “Explore the fun you can have with JSON.” }, "relationships": { "author": { "links": { "self": "/articles/1/relationships/author", "related": “/articles/1/author" } } } } }
  • 11. atharsis • a Greek word meaning "cleansing" or “purging” • Elegant and powerful HATEOAS framework for Java based on the JSON API standard • Uses ResourceRepository and ResourceRelationshipRepository • Annotation based or interface based • Modular • Core • Spring • JAX-RS • Servlet • Vertx • Examples • Very few dependencies
  • 12. Let’s look at Katharsis in Action
  • 13. Filter/Sort/Group/Pagination • GET /api/tasks?filter[tasks][name]=Make%20Coffee • GET /api/tasks?sort[tasks][name]=asc • GET /api/tasks?group[tasks]=name • GET /api/tasks?include[tasks]=project • GET /api/tasks?page[offset]=0&page[limit]=10
  • 14. Pagination using Links "links": { "self": “http://example.com/articles/22“, "first": “http://example.com/articles?page[offset]=0” "prev": “http://example.com/articles?page[offset]=1” "next": "http://example.com/articles?page[offset]=3", "last": "http://example.com/articles?page[offset]=10" }
  • 15. References and Links • http://jsonapi.org • https://en.wikipedia.org/wiki/HATEOAS • http://katharsis.io • https://en.wikipedia.org/wiki/Law_of_triviality