SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez YalonAdar Weidman
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API GatewayAmazon Web Services
 
Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Stormpath
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Kai Wähner
 
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectDemystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectVinay Manglani
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Araf Karsh Hamid
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principlesSanjoy Kumar Roy
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API PlatformJohannes Ridderstedt
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice ArchitectureWSO2
 

Mais procurados (20)

Amazon CloudFront 101
Amazon CloudFront 101Amazon CloudFront 101
Amazon CloudFront 101
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
 
Pentesting ReST API
Pentesting ReST APIPentesting ReST API
Pentesting ReST API
 
Api Gateway
Api GatewayApi Gateway
Api Gateway
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectDemystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Kong
KongKong
Kong
 
AWS IAM Introduction
AWS IAM IntroductionAWS IAM Introduction
AWS IAM Introduction
 
Fleet and elastic agent
Fleet and elastic agentFleet and elastic agent
Fleet and elastic agent
 
AWS networking fundamentals
AWS networking fundamentalsAWS networking fundamentals
AWS networking fundamentals
 

Mais de Patrick Savalle

REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / conceptsPatrick 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 managersPatrick Savalle
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick 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 primerPatrick 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 deltalloydPatrick Savalle
 
The future of work, a whitepaper
The future of work, a whitepaperThe future of work, a whitepaper
The future of work, a whitepaperPatrick 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 inspirationPatrick 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 methodPatrick Savalle
 
TeamPark: platform en methode
TeamPark: platform en methodeTeamPark: platform en methode
TeamPark: platform en methodePatrick Savalle
 
TeamPark: inspiratie en visie
TeamPark: inspiratie en visieTeamPark: inspiratie en visie
TeamPark: inspiratie en visiePatrick 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-methodPatrick 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 TeamParkPatrick Savalle
 

Mais de Patrick Savalle (17)

REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
 
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
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
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
 

Último

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 

Último (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 

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