SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
Formalising Solutions to REST API Practices
as Design (Anti)patterns
Van Tuan Tran, Manel Abdellatif and Yann-Gaël Guéhéneuc
Presenting at The 19th International Conference on Service-Oriented Computing
Table of Contents
1. Introduction
2. Related Work
3. Approach
4. (Anti)patterns
5. Evaluations
6. Discussion
7. Conclusion
2
1 - Introduction
3
1 - Introduction - Context
4
https://github.com/features/codespaces - https://www.windy.com/
1 - Introduction - Context
5
1 - Introduction - Context
6
REpresentational State Transfer
Application Programming Interface
1 - Introduction - Context
7
REpresentational State Transfer
Application Programming Interface
1 - Introduction - Terms
8
Practice noun
/ˈpræktɪs/
way of doing something
Good practice
good way to implement the REST API
Bad practice
Bad way to implement the REST API
https://www.oxfordlearnersdictionaries.com/us/definition/english/practice_1
1 - Introduction - Terms
9
Anti-pattern
“A commonly occurring solution to a problem that generates
negative consequences”
Problem Bad solution(s) Alternative good solution(s)
1 - Introduction
10
We propose 3 contributions
● Review academic and gray literature to identify REST API practices
● Propose practical solutions to these practices
● Validate our solutions with surveys and interviews
2 - Related Work
11
2 - Related Work - Practices
12
2010 - Content Negotiations
2011 - CRUDYs URIs
Use the wrong HTTP Verbs
Ignoring MIME Type
Context-less resource name
Non-hierarchical nodes
Singularized/Pluralized Nodes
List Pagination
2012 - API Versioning
Masse
2008 - Breaking Self-descriptiveness
Forgetting Hypermedia
Ignoring MIME type
Ignoring status code
Misusing cookies
Use the wrong HTTP Verbs
Stefan Tilkov
Rodriguez,
Crasso,
Zunino, and
Campo
Fredrich
2 - Related Work - Practices
13
2010 - Content Negotiations
2011 - CRUDYs URIs
Use the wrong HTTP Verbs
Ignoring MIME Type
Context-less resource name
Non-hierarchical nodes
Singularized/Pluralized Nodes
List Pagination
2012 - API Versioning
2008 - Breaking Self-descriptiveness
Forgetting Hypermedia
Ignoring MIME type
Ignoring status code
Misusing cookies
Use the wrong HTTP Verbs
Non-pertinent documentation - 2017
Palma et al.
2 - Related Work - Practices
14
2010 - Content Negotiations
2011 - CRUDYs URIs
Use the wrong HTTP Verbs
Ignoring MIME Type
Context-less resource name
Non-hierarchical nodes
Singularized/Pluralized Nodes
List Pagination
2012 - API Versioning
2008 - Breaking Self-descriptiveness
Forgetting Hypermedia
Ignoring MIME type
Ignoring status code
Misusing cookies
Use the wrong HTTP Verbs
Non-pertinent documentation - 2017
Server Timeout - 2021
Post-Put-Patch return - 2021
2 - Related Work - Existing Solutions
15
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
2 - Related Work - Existing Solutions
16
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
XML
JSON
Lemlouma
and Layaïda
2 - Related Work - Existing Solutions
17
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
XML
JSON
Butler
2 - Related Work - Existing Solutions
18
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
wrapper
Liskin, Singer,
and Schneider
2 - Related Work - Existing Solutions
19
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
Chain of Adapter
Kaminski, Litoiu,
and Muller
2 - Related Work - Existing Solutions
20
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
Version 1
Version 2
Version 1
Version 2
Leitner, Michlmayr,
Rosenberg, and
Dustdar
2 - Related Work - Existing Solutions
21
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
Eastbury et al.
2 - Related Work - Existing Solutions
22
● Content Negotiation
● Forgetting Hypermedia
● API Versioning
● Server Timeout
● Response Caching
● List Pagination
https://github.com/campusMVP/dotnetCoreLogoPack - https://spring.io/trademarks
3 - Approach
23
24
2 - Approach - Literature Review
25
2 - Approach - Categorization
Technical Non-technical
Content negotiation Entity Endpoint
Endpoint redirection Contextless Resource name
Entity Linking Non-hierarchical Nodes
Response caching Amorphous URIs
API Versioning CRUDy URIs
Server Timeout Singularized & Pluralized Nodes
POST-PUT-PATCH Return Non-pertinent Documentation
List Pagination Breaking Self-descriptiveness
Ignoring status code
Using the wrong HTTP Verbs
Misusing Cookies
Architectural
Devs pay attention
26
2 - Approach - Looking for Solutions
4 - REST API Anti-patterns
27
4 - REST API Anti-patterns - Overview
28
● Practice name
● Problem
● Expected result
● Solution
4 - REST API Anti-patterns - Sample Implementation
29
https://github.com/huntertran/restapi-practices-impl
4 - REST API Anti-patterns - Content Negotiation
30
● Problem
XML
JSON
2 3
1
4 - REST API Anti-patterns - Content Negotiation
31
● Expected result
XML
JSON
default
● JSON-XML
● JPG, PNG, Base64
● CSV, XLSX, ODS
● JSON-XML
● JPG, PNG, Base64
● CSV, XLSX, ODS
Easily modifiable
● GSON/Jackson/Javax.Json
● Javax.ImageIO/ImageJ/imgscalr
● FileReader/XStream/JacksonXML
4 - REST API Anti-patterns - Content Negotiation
32
● Solution
4 - REST API Anti-patterns - Content Negotiation
33
● Comparison
Java Spring ASP.NET Core Our solution
Common media types Yes Yes Yes
Customizable serializer No Yes Yes
No data annotation on model No Yes Yes
Built-in support ignorable Yes Yes N/A
4 - REST API Anti-patterns - Endpoint Redirection
34
● Problem
New location of
moved resources
O
l
d
U
R
I
H
T
T
P
3
0
2
M
o
v
e
d
4 - REST API Anti-patterns - Endpoint Redirection
35
● Solution
4 - REST API Anti-patterns - Entity Linking
36
● Problem
{
"post": {
"title": "Lorem ipsum",
"content": "Lorem ipsum",
"links": [
{
"rel": "comment",
"method": "post",
"uri": "/post/123/comment"
},
{
"rel": "like",
"method": "get",
"uri": "/post/123/like"
}
]
}
}
4 - REST API Anti-patterns - Entity Linking
37
● Solution
4 - REST API Anti-patterns - API Versioning
38
● Problem
Version 1
Version 2
Version 1
Version 2
4 - REST API Anti-patterns - API Versioning
39
● Solution
4 - REST API Anti-patterns - Server Timeout
40
● Problem
4 - REST API Anti-patterns - Server Timeout
41
● Solution
4 - REST API Anti-patterns - POST-PUT-PATCH return
42
● Problem
CREATE - UPDATE
HTTP 200 OK
Is object created correctly?
4 - REST API Anti-patterns - POST-PUT-PATCH return
43
● Solution
5 - Evaluations
44
5 - Evaluations - Survey Design
45
● Have you faced this problem(s)
in some of your project
● Is the proposed solution a good
solution?
https://acmsigsoft.github.io/EmpiricalStandards/docs/
55 participants 5 participants
5 - Evaluations - Survey Result - Age Groups & Education
46
Age Groups Education Levels
5 - Evaluations - Survey Result - Profession
47
5 - Evaluations - Survey Result - Experience
48
5 - Evaluations - Survey Result - Countries
49
5 - Evaluations - Survey Result - Positive on Solutions
50
Face this problem Std. dev. Good solution Std. dev.
Content Negotiation 52.40% 2.289 76.20% 1.952
Endpoint Redirection 45% 2.225 75% 1.936
Entity Linking 47.40% 2.177 57.90% 2.152
API Versioning 72.20% 1.901 72.20% 1.901
Server Timeout 77.80% 1.763 66.70% 1.999
POST-PUT-PATCH return 58.80% 2.029 82.40% 1.57
70%
5 - Evaluations - Survey Result - Explained
51
Entity Linking - 57.9% agreed good solution
Visitor Pattern
Visitor Pattern
5 - Evaluations - Survey Result - Explained
52
Entity Linking - 57.9% agreed good solution
List of permissions
5 - Evaluations - Survey Result - Explained
53
Server Timeout - 66.7% agreed good solution
HTTP Polling
Publisher
HTTP/2 gRPC
5 - Evaluations - Survey Result - Explained
54
Server Timeout - 66.7% agreed good solution
WebSocket Tunnel
HTTP Polling
5 - Evaluations - Survey Result - Explained
55
Server Timeout - 66.7% agreed good solution
Publisher
5 - Evaluations - Survey Result - Explained
https://engineering.salesforce.com/the-full-picture-on-http-2-and-hol-blocking-7f964b34d205 56
Server Timeout - 66.7% agreed good solution
HTTP/2 gRPC
Forced Encryption TPC Head-of-line Blocking
6 - Discussion
57
6 - Discussion - Internal Threats
58
JavaScript Go Groovy Java
Gin
Grails Apache Struts
6 - Discussion - External Threats
59
Year of experiences
Domain Knowledge
Favor new technologies
Easier to spot potential
problems of the practices
7 - Conclusion
60
7 - Conclusion
61
Our contributions:
1. Review REST API practices in both academic and gray literature.
2. Provide concrete solutions to 6 technical practices.
3. Validate the solutions with professional developers.
Thank you
Q & A
62

Weitere ähnliche Inhalte

Ähnlich wie ICSOC'21

Experimentation Platform on Hadoop
Experimentation Platform on HadoopExperimentation Platform on Hadoop
Experimentation Platform on HadoopDataWorks Summit
 
eBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopeBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopTony Ng
 
The Effect of Third Party Implementations on Reproducibility
The Effect of Third Party Implementations on ReproducibilityThe Effect of Third Party Implementations on Reproducibility
The Effect of Third Party Implementations on ReproducibilityBalázs Hidasi
 
Using REST and UI Testing to Test Ajax Web Applications
Using REST and UI Testing to Test Ajax Web ApplicationsUsing REST and UI Testing to Test Ajax Web Applications
Using REST and UI Testing to Test Ajax Web ApplicationsAdam Sandman
 
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...SERENEWorkshop
 
Pentaho PDI and the Jare Ruleengine
Pentaho PDI and the Jare RuleenginePentaho PDI and the Jare Ruleengine
Pentaho PDI and the Jare Ruleengineuwe geercken
 
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...Indus Khaitan
 
Resource Discovery Landscape
Resource Discovery LandscapeResource Discovery Landscape
Resource Discovery LandscapeAndy Powell
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1Qualitest
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting startedQualitest
 
Legacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseLegacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseAnatole Tresch
 
It's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolboxIt's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolboxStefan Lay
 
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...South Tyrol Free Software Conference
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL AdvancedLeanIX GmbH
 
Agile engineering environment 50 minutes or less
Agile engineering environment   50 minutes or lessAgile engineering environment   50 minutes or less
Agile engineering environment 50 minutes or lessVernon Stinebaker
 

Ähnlich wie ICSOC'21 (20)

Experimentation Platform on Hadoop
Experimentation Platform on HadoopExperimentation Platform on Hadoop
Experimentation Platform on Hadoop
 
eBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopeBay Experimentation Platform on Hadoop
eBay Experimentation Platform on Hadoop
 
sem5.pdf
sem5.pdfsem5.pdf
sem5.pdf
 
The Effect of Third Party Implementations on Reproducibility
The Effect of Third Party Implementations on ReproducibilityThe Effect of Third Party Implementations on Reproducibility
The Effect of Third Party Implementations on Reproducibility
 
Vue.js Use Cases
Vue.js Use CasesVue.js Use Cases
Vue.js Use Cases
 
Using REST and UI Testing to Test Ajax Web Applications
Using REST and UI Testing to Test Ajax Web ApplicationsUsing REST and UI Testing to Test Ajax Web Applications
Using REST and UI Testing to Test Ajax Web Applications
 
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...
SERENE 2014 Workshop: Paper "Combined Error Propagation Analysis and Runtime ...
 
Pentaho PDI and the Jare Ruleengine
Pentaho PDI and the Jare RuleenginePentaho PDI and the Jare Ruleengine
Pentaho PDI and the Jare Ruleengine
 
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...
Creating Interactive Olap Applications With My Sql Enterprise And Mondrian Pr...
 
Resource Discovery Landscape
Resource Discovery LandscapeResource Discovery Landscape
Resource Discovery Landscape
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting started
 
Legacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the EnterpriseLegacy Renewal of Central Framework in the Enterprise
Legacy Renewal of Central Framework in the Enterprise
 
It's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolboxIt's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolbox
 
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
SFScon18 - Kurt Ranalter - Leonhard Holzer - API level regression testing: a ...
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
 
Agile Engineering Environment – 2017
Agile Engineering Environment – 2017Agile Engineering Environment – 2017
Agile Engineering Environment – 2017
 
Agile Engineering Environment – 2017
Agile Engineering Environment – 2017Agile Engineering Environment – 2017
Agile Engineering Environment – 2017
 
Agile engineering environment 50 minutes or less
Agile engineering environment   50 minutes or lessAgile engineering environment   50 minutes or less
Agile engineering environment 50 minutes or less
 
Dust.js
Dust.jsDust.js
Dust.js
 

Mehr von Yann-Gaël Guéhéneuc

Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Yann-Gaël Guéhéneuc
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Yann-Gaël Guéhéneuc
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Yann-Gaël Guéhéneuc
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Yann-Gaël Guéhéneuc
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Yann-Gaël Guéhéneuc
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...Yann-Gaël Guéhéneuc
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesYann-Gaël Guéhéneuc
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Yann-Gaël Guéhéneuc
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1Yann-Gaël Guéhéneuc
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6Yann-Gaël Guéhéneuc
 

Mehr von Yann-Gaël Guéhéneuc (20)

Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its Consequences
 
Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
 
Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6
 
Vissoft21.ppt
Vissoft21.pptVissoft21.ppt
Vissoft21.ppt
 
Service computation20.ppt
Service computation20.pptService computation20.ppt
Service computation20.ppt
 
Serp4 iot20.ppt
Serp4 iot20.pptSerp4 iot20.ppt
Serp4 iot20.ppt
 
Msr20.ppt
Msr20.pptMsr20.ppt
Msr20.ppt
 
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Iwesep19.ppt
 
Icsoc20.ppt
Icsoc20.pptIcsoc20.ppt
Icsoc20.ppt
 
Icsoc18.ppt
Icsoc18.pptIcsoc18.ppt
Icsoc18.ppt
 
Icsm20.ppt
Icsm20.pptIcsm20.ppt
Icsm20.ppt
 

Kürzlich hochgeladen

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Kürzlich hochgeladen (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

ICSOC'21

  • 1. Formalising Solutions to REST API Practices as Design (Anti)patterns Van Tuan Tran, Manel Abdellatif and Yann-Gaël Guéhéneuc Presenting at The 19th International Conference on Service-Oriented Computing
  • 2. Table of Contents 1. Introduction 2. Related Work 3. Approach 4. (Anti)patterns 5. Evaluations 6. Discussion 7. Conclusion 2
  • 4. 1 - Introduction - Context 4 https://github.com/features/codespaces - https://www.windy.com/
  • 5. 1 - Introduction - Context 5
  • 6. 1 - Introduction - Context 6 REpresentational State Transfer Application Programming Interface
  • 7. 1 - Introduction - Context 7 REpresentational State Transfer Application Programming Interface
  • 8. 1 - Introduction - Terms 8 Practice noun /ˈpræktɪs/ way of doing something Good practice good way to implement the REST API Bad practice Bad way to implement the REST API https://www.oxfordlearnersdictionaries.com/us/definition/english/practice_1
  • 9. 1 - Introduction - Terms 9 Anti-pattern “A commonly occurring solution to a problem that generates negative consequences” Problem Bad solution(s) Alternative good solution(s)
  • 10. 1 - Introduction 10 We propose 3 contributions ● Review academic and gray literature to identify REST API practices ● Propose practical solutions to these practices ● Validate our solutions with surveys and interviews
  • 11. 2 - Related Work 11
  • 12. 2 - Related Work - Practices 12 2010 - Content Negotiations 2011 - CRUDYs URIs Use the wrong HTTP Verbs Ignoring MIME Type Context-less resource name Non-hierarchical nodes Singularized/Pluralized Nodes List Pagination 2012 - API Versioning Masse 2008 - Breaking Self-descriptiveness Forgetting Hypermedia Ignoring MIME type Ignoring status code Misusing cookies Use the wrong HTTP Verbs Stefan Tilkov Rodriguez, Crasso, Zunino, and Campo Fredrich
  • 13. 2 - Related Work - Practices 13 2010 - Content Negotiations 2011 - CRUDYs URIs Use the wrong HTTP Verbs Ignoring MIME Type Context-less resource name Non-hierarchical nodes Singularized/Pluralized Nodes List Pagination 2012 - API Versioning 2008 - Breaking Self-descriptiveness Forgetting Hypermedia Ignoring MIME type Ignoring status code Misusing cookies Use the wrong HTTP Verbs Non-pertinent documentation - 2017 Palma et al.
  • 14. 2 - Related Work - Practices 14 2010 - Content Negotiations 2011 - CRUDYs URIs Use the wrong HTTP Verbs Ignoring MIME Type Context-less resource name Non-hierarchical nodes Singularized/Pluralized Nodes List Pagination 2012 - API Versioning 2008 - Breaking Self-descriptiveness Forgetting Hypermedia Ignoring MIME type Ignoring status code Misusing cookies Use the wrong HTTP Verbs Non-pertinent documentation - 2017 Server Timeout - 2021 Post-Put-Patch return - 2021
  • 15. 2 - Related Work - Existing Solutions 15 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination
  • 16. 2 - Related Work - Existing Solutions 16 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination XML JSON Lemlouma and Layaïda
  • 17. 2 - Related Work - Existing Solutions 17 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination XML JSON Butler
  • 18. 2 - Related Work - Existing Solutions 18 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination wrapper Liskin, Singer, and Schneider
  • 19. 2 - Related Work - Existing Solutions 19 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination Chain of Adapter Kaminski, Litoiu, and Muller
  • 20. 2 - Related Work - Existing Solutions 20 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination Version 1 Version 2 Version 1 Version 2 Leitner, Michlmayr, Rosenberg, and Dustdar
  • 21. 2 - Related Work - Existing Solutions 21 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination Eastbury et al.
  • 22. 2 - Related Work - Existing Solutions 22 ● Content Negotiation ● Forgetting Hypermedia ● API Versioning ● Server Timeout ● Response Caching ● List Pagination https://github.com/campusMVP/dotnetCoreLogoPack - https://spring.io/trademarks
  • 24. 24 2 - Approach - Literature Review
  • 25. 25 2 - Approach - Categorization Technical Non-technical Content negotiation Entity Endpoint Endpoint redirection Contextless Resource name Entity Linking Non-hierarchical Nodes Response caching Amorphous URIs API Versioning CRUDy URIs Server Timeout Singularized & Pluralized Nodes POST-PUT-PATCH Return Non-pertinent Documentation List Pagination Breaking Self-descriptiveness Ignoring status code Using the wrong HTTP Verbs Misusing Cookies Architectural Devs pay attention
  • 26. 26 2 - Approach - Looking for Solutions
  • 27. 4 - REST API Anti-patterns 27
  • 28. 4 - REST API Anti-patterns - Overview 28 ● Practice name ● Problem ● Expected result ● Solution
  • 29. 4 - REST API Anti-patterns - Sample Implementation 29 https://github.com/huntertran/restapi-practices-impl
  • 30. 4 - REST API Anti-patterns - Content Negotiation 30 ● Problem XML JSON
  • 31. 2 3 1 4 - REST API Anti-patterns - Content Negotiation 31 ● Expected result XML JSON default ● JSON-XML ● JPG, PNG, Base64 ● CSV, XLSX, ODS ● JSON-XML ● JPG, PNG, Base64 ● CSV, XLSX, ODS Easily modifiable ● GSON/Jackson/Javax.Json ● Javax.ImageIO/ImageJ/imgscalr ● FileReader/XStream/JacksonXML
  • 32. 4 - REST API Anti-patterns - Content Negotiation 32 ● Solution
  • 33. 4 - REST API Anti-patterns - Content Negotiation 33 ● Comparison Java Spring ASP.NET Core Our solution Common media types Yes Yes Yes Customizable serializer No Yes Yes No data annotation on model No Yes Yes Built-in support ignorable Yes Yes N/A
  • 34. 4 - REST API Anti-patterns - Endpoint Redirection 34 ● Problem New location of moved resources O l d U R I H T T P 3 0 2 M o v e d
  • 35. 4 - REST API Anti-patterns - Endpoint Redirection 35 ● Solution
  • 36. 4 - REST API Anti-patterns - Entity Linking 36 ● Problem { "post": { "title": "Lorem ipsum", "content": "Lorem ipsum", "links": [ { "rel": "comment", "method": "post", "uri": "/post/123/comment" }, { "rel": "like", "method": "get", "uri": "/post/123/like" } ] } }
  • 37. 4 - REST API Anti-patterns - Entity Linking 37 ● Solution
  • 38. 4 - REST API Anti-patterns - API Versioning 38 ● Problem Version 1 Version 2 Version 1 Version 2
  • 39. 4 - REST API Anti-patterns - API Versioning 39 ● Solution
  • 40. 4 - REST API Anti-patterns - Server Timeout 40 ● Problem
  • 41. 4 - REST API Anti-patterns - Server Timeout 41 ● Solution
  • 42. 4 - REST API Anti-patterns - POST-PUT-PATCH return 42 ● Problem CREATE - UPDATE HTTP 200 OK Is object created correctly?
  • 43. 4 - REST API Anti-patterns - POST-PUT-PATCH return 43 ● Solution
  • 45. 5 - Evaluations - Survey Design 45 ● Have you faced this problem(s) in some of your project ● Is the proposed solution a good solution? https://acmsigsoft.github.io/EmpiricalStandards/docs/ 55 participants 5 participants
  • 46. 5 - Evaluations - Survey Result - Age Groups & Education 46 Age Groups Education Levels
  • 47. 5 - Evaluations - Survey Result - Profession 47
  • 48. 5 - Evaluations - Survey Result - Experience 48
  • 49. 5 - Evaluations - Survey Result - Countries 49
  • 50. 5 - Evaluations - Survey Result - Positive on Solutions 50 Face this problem Std. dev. Good solution Std. dev. Content Negotiation 52.40% 2.289 76.20% 1.952 Endpoint Redirection 45% 2.225 75% 1.936 Entity Linking 47.40% 2.177 57.90% 2.152 API Versioning 72.20% 1.901 72.20% 1.901 Server Timeout 77.80% 1.763 66.70% 1.999 POST-PUT-PATCH return 58.80% 2.029 82.40% 1.57 70%
  • 51. 5 - Evaluations - Survey Result - Explained 51 Entity Linking - 57.9% agreed good solution Visitor Pattern
  • 52. Visitor Pattern 5 - Evaluations - Survey Result - Explained 52 Entity Linking - 57.9% agreed good solution List of permissions
  • 53. 5 - Evaluations - Survey Result - Explained 53 Server Timeout - 66.7% agreed good solution HTTP Polling Publisher HTTP/2 gRPC
  • 54. 5 - Evaluations - Survey Result - Explained 54 Server Timeout - 66.7% agreed good solution WebSocket Tunnel HTTP Polling
  • 55. 5 - Evaluations - Survey Result - Explained 55 Server Timeout - 66.7% agreed good solution Publisher
  • 56. 5 - Evaluations - Survey Result - Explained https://engineering.salesforce.com/the-full-picture-on-http-2-and-hol-blocking-7f964b34d205 56 Server Timeout - 66.7% agreed good solution HTTP/2 gRPC Forced Encryption TPC Head-of-line Blocking
  • 58. 6 - Discussion - Internal Threats 58 JavaScript Go Groovy Java Gin Grails Apache Struts
  • 59. 6 - Discussion - External Threats 59 Year of experiences Domain Knowledge Favor new technologies Easier to spot potential problems of the practices
  • 61. 7 - Conclusion 61 Our contributions: 1. Review REST API practices in both academic and gray literature. 2. Provide concrete solutions to 6 technical practices. 3. Validate the solutions with professional developers.