SlideShare a Scribd company logo
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
*
*
*
*
TICKETS
PUT /tickets/<id>
DELETE /tickets/<id>
DELETE /trips/<id>/travelers/<id>/tickets
GET /tickets/<id>
GET /trips/<id>/travelers/<id>/tickets
POST /trips/<id>/travelers/<id>/tickets
TICKETS
PUT /tickets/<id>
DELETE /tickets/<id>
DELETE /trips/<id>/travelers/<id>/tickets
GET /tickets/<id>
GET /trips/<id>/travelers/<id>/tickets
POST /trips/<id>/travelers/<id>/tickets
TICKETS
PUT /tickets/<id>
DELETE /tickets/<id>
DELETE /trips/<id>/travelers/<id>/tickets
GET /tickets/<id>
GET /trips/<id>/travelers/<id>/tickets
POST /trips/<id>/travelers/<id>/tickets
TRAVELERS
PUT /travelers/<id>
DELETE /travelers/<id>
DELETE /trips/<id>/travelers
GET /travelers/id>
GET /trips/<id>/travelers
POST /trips/<id>/travelers
TRAVELERS
PUT /travelers/<id>
DELETE /travelers/<id>
DELETE /trips/<id>/travelers
GET /travelers/id>
GET /trips/<id>/travelers
POST /trips/<id>/travelers
TRAVELERS
PUT /travelers/<id>
DELETE /travelers/<id>
DELETE /trips/<id>/travelers
GET /travelers/id>
GET /trips/<id>/travelers
POST /trips/<id>/travelers
*
1
*
1
TRIPS
PUT /trips/<id>
POST /trips
GET /trips
GET /trips/<id>
DELETE /trips/<id>
TRIPS
PUT /trips/<id>
POST /trips
GET /trips
GET /trips/<id>
DELETE /trips/<id>
TRIPS
PUT /trips/<id>
POST /trips
GET /trips
GET /trips/<id>
DELETE /trips/<id>
*
1
*
1
TRAVELERS
POST /trips/<id>/travelers
TRAVELERS
POST /trips/<id>/travelers
TRAVELERS
POST /trips/<id>/travelers
TRIPS
POST /trips
TRIPS
POST /trips
TRIPS
POST /trips
*
1
*
1
AGGREGATION-PATTERN (INDEPENDENT LIFECYCLES)
• USE WHEN INSTANCES OF BOTH TYPES IN A RELATIONSHIP CAN EXIST INDEPENDENT OF EACH OTHER
• PUT THE ENDPOINTS OF BOTH TYPES IN THEIR OWN NAMESPACE/PATH.
COMPOSITION-PATTERN (DEPENDENT LIFECYCLES / WHOLE-PART RELATIONSHIP)
REFLECT WHOLE-PART RELATIONSHIPS / HIERARCHY IN THE PATH OF AN ENDPOINT TO REFLECT THE RIGHT SEQUENCE IN WHICH
TO RETRIEVE AND MANIPULATE RESOURCES.
• USE WHEN INSTANCES OF ONE TYPE (E.G. TRAVELER) CANNOT EXIST INDEPENDENT OF INSTANCES OF OTHER TYPE (E.G. TRIP
• PREPEND THE ENDPOINTS OF THE DEPENDENT TYPE (TYPE TRAVELERS IN THIS EXAMPLE) WITH THE OTHER TYPE S PATH
TRAVELERS
DELETE /trips/<id>/travelers
DELETE /trips/<id>/travelers/<id>
TRAVELERS
DELETE /trips/<id>/travelers
DELETE /trips/<id>/travelers/<id>
TRAVELERS
DELETE /trips/<id>/travelers
DELETE /trips/<id>/travelers/<id>
TRIPS
DELETE /trips/<id>
TRIPS
DELETE /trips/<id>
TRIPS
DELETE /trips/<id>
*
1
*
1
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRIPS
GET /trips/<id>
TRIPS
GET /trips/<id>
TRIPS
GET /trips/<id>
*
1
*
1
TRAVELERS
PUT /trips/<id>/travelers/<id>
TRAVELERS
PUT /trips/<id>/travelers/<id>
TRAVELERS
PUT /trips/<id>/travelers/<id>
TRIPS
PUT /trips/<id>
TRIPS
PUT /trips/<id>
TRIPS
PUT /trips/<id>
*
1
*
1
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRAVELERS
GET /trips/<id>/travelers
GET /trips/<id>/travelers/<id>
TRIPS
GET /trips
GET /trips/<id>
TRIPS
GET /trips
GET /trips/<id>
TRIPS
GET /trips
GET /trips/<id>
*
1
*
1
TICKETS
GET /trips/<id>/travelers/<id>/tickets
GET /trips/<id>/travelers/<id>/tickets/<id>
TICKETS
GET /trips/<id>/travelers/<id>/tickets
GET /trips/<id>/travelers/<id>/tickets/<id>
TICKETS
GET /trips/<id>/travelers/<id>/tickets
GET /trips/<id>/travelers/<id>/tickets/<id>
*
1
*
1
TRAIN-TICKETS
POST /tickets/trains
PUT /tickets/trains/<id>
TRAIN-TICKETS
POST /tickets/trains
PUT /tickets/trains/<id>
TRAIN-TICKETS
POST /tickets/trains
PUT /tickets/trains/<id>
TICKETS
DELETE /tickets/<id>
GET /tickets
GET /tickets/<id>
TICKETS
DELETE /tickets/<id>
GET /tickets
GET /tickets/<id>
TICKETS
DELETE /tickets/<id>
GET /tickets
GET /tickets/<id>
INHERITANCE-PATTERN
REDUCES THE NUMBER OF ENDPOINTS.
• PUT THE POST, PUT AND PATCH METHODS IN SUBTYPES
• PUT THE DELETE AND GET METHODS IN THE SUPER TYPE.
• WILL ONLY WORK IF AL INSTANCES HAVE UNIQUE ID S ACROSS THE HIERARCHY.
AIRPLANE-TICKETS
POST /tickets/airplanes
PUT /tickets/airplanes/<id>
AIRPLANE-TICKETS
POST /tickets/airplanes
PUT /tickets/airplanes/<id>
AIRPLANE-TICKETS
POST /tickets/airplanes
PUT /tickets/airplanes/<id>
1. VISUALIZE THE LOGICAL DATAMODEL
CREATE THE CUSTOMER FACING LOGICAL DATAMODEL. AVOID STRICT 3NF-NORMALIZATION, N:M
RELATIONSHIPS ARE ALLOWED. USE ASSOCIATION AND INHERITANCE. BE VERY STRICT WITH THE
MULTIPLICITIES ON BOTH ENDS OF THE ASSOCIATIONS. MODEL NOT ONLY PERSISTENT TYPES BUT ALL
TYPES INCLUDING VOLATILE TYPES SUCH AS CALCULATED RESULTS.
REST-API ENDPOINT DESIGN PATTERNS
Created by: patrick.savalle@nn-group.com
2. ASSIGN ENDPOINTS TO TYPES
EACH TYPE GETS ITS OWN SET OF APPROPRIATE HTTP-METHODS (POST, PUT, PATCH, DELETE, GET) AND PATHS.
ESSENTIALLY CONVERTING THE DATAMODEL INTO A CLASS-MODEL. USE THE GUIDELINES ON THE RIGHT TO
DETERMINE THE MOST NATURAL ENDPOINT PATHS.
GUIDELINE: REFLECT RELATIONSHIPS IN ENDPOINT PATHS
DEPENDING ON THE TYPE OF ASSOCIATION BETWEEN TYPES (AGGREGATION VS. COMPOSITION) PREPEND THE PATHS OF PARTS WITH THE
PATHS OF THEIR WHOLES DEPENDENT PARTS SHOULD GENERALLY BE ACCESSED THROUGH THE WHOLE.
TICKETSTICKETSTICKETS
TRAVELERSTRAVELERSTRAVELERS
*
1
*
1
TRIPSTRIPSTRIPS
*
1
*
1
3. MATCH THE ENDPOINTS TO PROCESS STEPS
DRAW BPMN2 DIAGRAMS FOR A REPRESENTATIVE SET OF SCENARIO S AND RUN THEM AGAINST THE API.
A GOOD API SHOULD HAVE ITS ENDPOINTS CORRESPOND TO INDIVIDUAL PROCESS STEPS, ALMOST ONE-
ON-ONE.
4.REFINE
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRAVELERS
POST /travelers
DELETE /travelers/<id>
GET /travelers[/<id>]
PUT /travelers/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
TRIPS
POST /trips
DELETE /trips/<id>
GET /trips[/<id>]
PUT /trips/<id>
*
0..1
*
0..1

More Related Content

What's hot

Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
Kerry Buckley
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
Patrick Savalle
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
The Software House
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
Ashok Pundit
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)
José Roberto Araújo
 
Web api using rest based architecture
Web api using rest based architectureWeb api using rest based architecture
Web api using rest based architecture
Soham Kulkarni
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
Amazon Web Services
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
Ankita Mahajan
 
Design pattern talk by Kaya Weers - 2024
Design pattern talk by Kaya Weers - 2024Design pattern talk by Kaya Weers - 2024
Design pattern talk by Kaya Weers - 2024
Kaya Weers
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
Stormpath
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?
connectwebex
 
React Router: React Meetup XXL
React Router: React Meetup XXLReact Router: React Meetup XXL
React Router: React Meetup XXL
Rob Gietema
 
Web API(Dynamics 365 )勉強会
Web API(Dynamics 365 )勉強会Web API(Dynamics 365 )勉強会
Web API(Dynamics 365 )勉強会
Kazuya Sugimoto
 
Next.js - ReactPlayIO.pptx
Next.js - ReactPlayIO.pptxNext.js - ReactPlayIO.pptx
Next.js - ReactPlayIO.pptx
DivyanshGupta922023
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPI
Octavian Nadolu
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 

What's hot (20)

Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)
 
Web api using rest based architecture
Web api using rest based architectureWeb api using rest based architecture
Web api using rest based architecture
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
Design pattern talk by Kaya Weers - 2024
Design pattern talk by Kaya Weers - 2024Design pattern talk by Kaya Weers - 2024
Design pattern talk by Kaya Weers - 2024
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?
 
React Router: React Meetup XXL
React Router: React Meetup XXLReact Router: React Meetup XXL
React Router: React Meetup XXL
 
Web API(Dynamics 365 )勉強会
Web API(Dynamics 365 )勉強会Web API(Dynamics 365 )勉強会
Web API(Dynamics 365 )勉強会
 
Next.js - ReactPlayIO.pptx
Next.js - ReactPlayIO.pptxNext.js - ReactPlayIO.pptx
Next.js - ReactPlayIO.pptx
 
JSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPIJSON, JSON Schema, and OpenAPI
JSON, JSON Schema, and OpenAPI
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 

More from Patrick Savalle

Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
Patrick Savalle
 
REST-API's for architects and managers
REST-API's for architects and managersREST-API's for architects and managers
REST-API's for architects and managers
Patrick Savalle
 
State of technology and innovation (2017 edition)
State of technology and innovation  (2017 edition)State of technology and innovation  (2017 edition)
State of technology and innovation (2017 edition)
Patrick Savalle
 
A bitcoin and blockchain primer
A bitcoin and blockchain primerA bitcoin and blockchain primer
A bitcoin and blockchain primer
Patrick Savalle
 
A quick review of (near future) disruptions and innovations.
A quick review of (near future) disruptions and innovations.A quick review of (near future) disruptions and innovations.
A quick review of (near future) disruptions and innovations.
Patrick Savalle
 
Bitcoin presentation deltalloyd
Bitcoin presentation deltalloydBitcoin presentation deltalloyd
Bitcoin presentation deltalloyd
Patrick Savalle
 
The future of work, a whitepaper
The future of work, a whitepaperThe future of work, a whitepaper
The future of work, a whitepaper
Patrick Savalle
 
TeamPark book (english) part 1, vision and inspiration
TeamPark book (english)  part 1, vision and inspirationTeamPark book (english)  part 1, vision and inspiration
TeamPark book (english) part 1, vision and inspiration
Patrick Savalle
 
TeamPark book (english) part 2, platform and method
TeamPark book (english)   part 2, platform and methodTeamPark book (english)   part 2, platform and method
TeamPark book (english) part 2, platform and method
Patrick Savalle
 
TeamPark: platform en methode
TeamPark: platform en methodeTeamPark: platform en methode
TeamPark: platform en methode
Patrick Savalle
 
TeamPark: inspiratie en visie
TeamPark: inspiratie en visieTeamPark: inspiratie en visie
TeamPark: inspiratie en visie
Patrick Savalle
 
Social Platform Design
Social Platform DesignSocial Platform Design
Social Platform Design
Patrick Savalle
 
Build the socially integrated organization with the TeamPark-method
Build the socially integrated organization with the TeamPark-methodBuild the socially integrated organization with the TeamPark-method
Build the socially integrated organization with the TeamPark-method
Patrick Savalle
 
TeamPark: Alternatieve presentatie (NL)
TeamPark: Alternatieve presentatie (NL)TeamPark: Alternatieve presentatie (NL)
TeamPark: Alternatieve presentatie (NL)
Patrick Savalle
 
Building Intelligent Organizations with Sogeti TeamPark
Building Intelligent Organizations with Sogeti TeamParkBuilding Intelligent Organizations with Sogeti TeamPark
Building Intelligent Organizations with Sogeti TeamPark
Patrick Savalle
 

More from Patrick Savalle (15)

Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
REST-API's for architects and managers
REST-API's for architects and managersREST-API's for architects and managers
REST-API's for architects and managers
 
State of technology and innovation (2017 edition)
State of technology and innovation  (2017 edition)State of technology and innovation  (2017 edition)
State of technology and innovation (2017 edition)
 
A bitcoin and blockchain primer
A bitcoin and blockchain primerA bitcoin and blockchain primer
A bitcoin and blockchain primer
 
A quick review of (near future) disruptions and innovations.
A quick review of (near future) disruptions and innovations.A quick review of (near future) disruptions and innovations.
A quick review of (near future) disruptions and innovations.
 
Bitcoin presentation deltalloyd
Bitcoin presentation deltalloydBitcoin presentation deltalloyd
Bitcoin presentation deltalloyd
 
The future of work, a whitepaper
The future of work, a whitepaperThe future of work, a whitepaper
The future of work, a whitepaper
 
TeamPark book (english) part 1, vision and inspiration
TeamPark book (english)  part 1, vision and inspirationTeamPark book (english)  part 1, vision and inspiration
TeamPark book (english) part 1, vision and inspiration
 
TeamPark book (english) part 2, platform and method
TeamPark book (english)   part 2, platform and methodTeamPark book (english)   part 2, platform and method
TeamPark book (english) part 2, platform and method
 
TeamPark: platform en methode
TeamPark: platform en methodeTeamPark: platform en methode
TeamPark: platform en methode
 
TeamPark: inspiratie en visie
TeamPark: inspiratie en visieTeamPark: inspiratie en visie
TeamPark: inspiratie en visie
 
Social Platform Design
Social Platform DesignSocial Platform Design
Social Platform Design
 
Build the socially integrated organization with the TeamPark-method
Build the socially integrated organization with the TeamPark-methodBuild the socially integrated organization with the TeamPark-method
Build the socially integrated organization with the TeamPark-method
 
TeamPark: Alternatieve presentatie (NL)
TeamPark: Alternatieve presentatie (NL)TeamPark: Alternatieve presentatie (NL)
TeamPark: Alternatieve presentatie (NL)
 
Building Intelligent Organizations with Sogeti TeamPark
Building Intelligent Organizations with Sogeti TeamParkBuilding Intelligent Organizations with Sogeti TeamPark
Building Intelligent Organizations with Sogeti TeamPark
 

Recently uploaded

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 

Recently uploaded (20)

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 

REST-API design patterns

  • 1. TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> * * * * TICKETS PUT /tickets/<id> DELETE /tickets/<id> DELETE /trips/<id>/travelers/<id>/tickets GET /tickets/<id> GET /trips/<id>/travelers/<id>/tickets POST /trips/<id>/travelers/<id>/tickets TICKETS PUT /tickets/<id> DELETE /tickets/<id> DELETE /trips/<id>/travelers/<id>/tickets GET /tickets/<id> GET /trips/<id>/travelers/<id>/tickets POST /trips/<id>/travelers/<id>/tickets TICKETS PUT /tickets/<id> DELETE /tickets/<id> DELETE /trips/<id>/travelers/<id>/tickets GET /tickets/<id> GET /trips/<id>/travelers/<id>/tickets POST /trips/<id>/travelers/<id>/tickets TRAVELERS PUT /travelers/<id> DELETE /travelers/<id> DELETE /trips/<id>/travelers GET /travelers/id> GET /trips/<id>/travelers POST /trips/<id>/travelers TRAVELERS PUT /travelers/<id> DELETE /travelers/<id> DELETE /trips/<id>/travelers GET /travelers/id> GET /trips/<id>/travelers POST /trips/<id>/travelers TRAVELERS PUT /travelers/<id> DELETE /travelers/<id> DELETE /trips/<id>/travelers GET /travelers/id> GET /trips/<id>/travelers POST /trips/<id>/travelers * 1 * 1 TRIPS PUT /trips/<id> POST /trips GET /trips GET /trips/<id> DELETE /trips/<id> TRIPS PUT /trips/<id> POST /trips GET /trips GET /trips/<id> DELETE /trips/<id> TRIPS PUT /trips/<id> POST /trips GET /trips GET /trips/<id> DELETE /trips/<id> * 1 * 1 TRAVELERS POST /trips/<id>/travelers TRAVELERS POST /trips/<id>/travelers TRAVELERS POST /trips/<id>/travelers TRIPS POST /trips TRIPS POST /trips TRIPS POST /trips * 1 * 1 AGGREGATION-PATTERN (INDEPENDENT LIFECYCLES) • USE WHEN INSTANCES OF BOTH TYPES IN A RELATIONSHIP CAN EXIST INDEPENDENT OF EACH OTHER • PUT THE ENDPOINTS OF BOTH TYPES IN THEIR OWN NAMESPACE/PATH. COMPOSITION-PATTERN (DEPENDENT LIFECYCLES / WHOLE-PART RELATIONSHIP) REFLECT WHOLE-PART RELATIONSHIPS / HIERARCHY IN THE PATH OF AN ENDPOINT TO REFLECT THE RIGHT SEQUENCE IN WHICH TO RETRIEVE AND MANIPULATE RESOURCES. • USE WHEN INSTANCES OF ONE TYPE (E.G. TRAVELER) CANNOT EXIST INDEPENDENT OF INSTANCES OF OTHER TYPE (E.G. TRIP • PREPEND THE ENDPOINTS OF THE DEPENDENT TYPE (TYPE TRAVELERS IN THIS EXAMPLE) WITH THE OTHER TYPE S PATH TRAVELERS DELETE /trips/<id>/travelers DELETE /trips/<id>/travelers/<id> TRAVELERS DELETE /trips/<id>/travelers DELETE /trips/<id>/travelers/<id> TRAVELERS DELETE /trips/<id>/travelers DELETE /trips/<id>/travelers/<id> TRIPS DELETE /trips/<id> TRIPS DELETE /trips/<id> TRIPS DELETE /trips/<id> * 1 * 1 TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRIPS GET /trips/<id> TRIPS GET /trips/<id> TRIPS GET /trips/<id> * 1 * 1 TRAVELERS PUT /trips/<id>/travelers/<id> TRAVELERS PUT /trips/<id>/travelers/<id> TRAVELERS PUT /trips/<id>/travelers/<id> TRIPS PUT /trips/<id> TRIPS PUT /trips/<id> TRIPS PUT /trips/<id> * 1 * 1 TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRAVELERS GET /trips/<id>/travelers GET /trips/<id>/travelers/<id> TRIPS GET /trips GET /trips/<id> TRIPS GET /trips GET /trips/<id> TRIPS GET /trips GET /trips/<id> * 1 * 1 TICKETS GET /trips/<id>/travelers/<id>/tickets GET /trips/<id>/travelers/<id>/tickets/<id> TICKETS GET /trips/<id>/travelers/<id>/tickets GET /trips/<id>/travelers/<id>/tickets/<id> TICKETS GET /trips/<id>/travelers/<id>/tickets GET /trips/<id>/travelers/<id>/tickets/<id> * 1 * 1 TRAIN-TICKETS POST /tickets/trains PUT /tickets/trains/<id> TRAIN-TICKETS POST /tickets/trains PUT /tickets/trains/<id> TRAIN-TICKETS POST /tickets/trains PUT /tickets/trains/<id> TICKETS DELETE /tickets/<id> GET /tickets GET /tickets/<id> TICKETS DELETE /tickets/<id> GET /tickets GET /tickets/<id> TICKETS DELETE /tickets/<id> GET /tickets GET /tickets/<id> INHERITANCE-PATTERN REDUCES THE NUMBER OF ENDPOINTS. • PUT THE POST, PUT AND PATCH METHODS IN SUBTYPES • PUT THE DELETE AND GET METHODS IN THE SUPER TYPE. • WILL ONLY WORK IF AL INSTANCES HAVE UNIQUE ID S ACROSS THE HIERARCHY. AIRPLANE-TICKETS POST /tickets/airplanes PUT /tickets/airplanes/<id> AIRPLANE-TICKETS POST /tickets/airplanes PUT /tickets/airplanes/<id> AIRPLANE-TICKETS POST /tickets/airplanes PUT /tickets/airplanes/<id> 1. VISUALIZE THE LOGICAL DATAMODEL CREATE THE CUSTOMER FACING LOGICAL DATAMODEL. AVOID STRICT 3NF-NORMALIZATION, N:M RELATIONSHIPS ARE ALLOWED. USE ASSOCIATION AND INHERITANCE. BE VERY STRICT WITH THE MULTIPLICITIES ON BOTH ENDS OF THE ASSOCIATIONS. MODEL NOT ONLY PERSISTENT TYPES BUT ALL TYPES INCLUDING VOLATILE TYPES SUCH AS CALCULATED RESULTS. REST-API ENDPOINT DESIGN PATTERNS Created by: patrick.savalle@nn-group.com 2. ASSIGN ENDPOINTS TO TYPES EACH TYPE GETS ITS OWN SET OF APPROPRIATE HTTP-METHODS (POST, PUT, PATCH, DELETE, GET) AND PATHS. ESSENTIALLY CONVERTING THE DATAMODEL INTO A CLASS-MODEL. USE THE GUIDELINES ON THE RIGHT TO DETERMINE THE MOST NATURAL ENDPOINT PATHS. GUIDELINE: REFLECT RELATIONSHIPS IN ENDPOINT PATHS DEPENDING ON THE TYPE OF ASSOCIATION BETWEEN TYPES (AGGREGATION VS. COMPOSITION) PREPEND THE PATHS OF PARTS WITH THE PATHS OF THEIR WHOLES DEPENDENT PARTS SHOULD GENERALLY BE ACCESSED THROUGH THE WHOLE. TICKETSTICKETSTICKETS TRAVELERSTRAVELERSTRAVELERS * 1 * 1 TRIPSTRIPSTRIPS * 1 * 1 3. MATCH THE ENDPOINTS TO PROCESS STEPS DRAW BPMN2 DIAGRAMS FOR A REPRESENTATIVE SET OF SCENARIO S AND RUN THEM AGAINST THE API. A GOOD API SHOULD HAVE ITS ENDPOINTS CORRESPOND TO INDIVIDUAL PROCESS STEPS, ALMOST ONE- ON-ONE. 4.REFINE TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRAVELERS POST /travelers DELETE /travelers/<id> GET /travelers[/<id>] PUT /travelers/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> TRIPS POST /trips DELETE /trips/<id> GET /trips[/<id>] PUT /trips/<id> * 0..1 * 0..1