SlideShare a Scribd company logo
1 of 38
Download to read offline
RestFest 2017
orubel@gmail.comOwen Rubel
API Chaining™
& API Abstraction
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What is API Chaining™?
“ API Chaining is a monad allowing a series of api
calls to be passed and processed using one
REQUEST/RESPONSE.”
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Abstraction of Communication Logic/Data from Biz Logic
• Internal Redirect Handling in API Service
• Separated Communication Data from Communication Logic
Requirements for API Chaining™
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Understanding API Abstraction
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“ An API is Standardized Input/Output (I/O) to/from
a Separation of Concern (usually being Business
Logic).”
In Short :
What Is An API? (1 OF 2)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Is An API? (2 OF 2)
owenr@uw.edu
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Is Separation of Concern? (2 of 2)
Bound Secondary
Concern
(Communication
Logic)
Primary
Concern
(Business Logic)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“ In computer science, separation of concerns (SoC) is a
design principle for separating a computer program
into distinct sections, such that each section addresses
a separate concern. A concern is a set of information that
affects the code of a computer program” (ex HTML, CSS,
JS)
- Source : Separation Of Concern, Wikipedia
What Is Separation of Concern?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“Cross-cutting concerns can be directly responsible for tangling,
or system inter-dependencies, within a program. Because
procedural and functional language constructs consist entirely of
procedure calling, there is no semantic through where two
goals (the capability to be implemented and the related cross-
cutting concern) can be addressed simultaneously.[3] As a
result, the code addressing the cross-cutting concern must be
scattered, or duplicated, across the various related locations,
resulting in a loss of modularity.[2]”
- Source : Cross Cutting Concern, Wikipedia
What is a Cross Cutting Concern?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Synchronization
• Real-time constraints
• Error detection and correction
• Product features
• Memory management
• Data validation
• Persistence
• Transaction processing
• Internationalization and localization which includes
Language localisation
• Information security
• Caching
• Logging
• Monitoring
• Business rules
• Code mobility
• Domain-specific optimizations
Issues of a Cross Cutting Concern
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This is The API Patterns Brick Wall
Brick Wall
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
So How Do We Fix?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Old API Pattern in MVC
redirect/response
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
New API Pattern in MVC
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Shared I/O State In Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This handles the Redirect and allows
communication to take place internally when
needed…
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This allows:
• Central Piece of architecture (where REQUEST AND RESPONSE
are handled) to be ‘Single Version of Truth’ (SOV) called ‘IO State’
• All services can sync data from SOV
• Failure of SOV DOES NOT affect synchronization of data
• Reload state on the fly at SOV and update ALL subscribed services
Shared IO State
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
So What Is IO State?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What is IO State?
• Caches Communications Data
• Synchronizes Architectural Props (distribute rules of communication)
• Handles API Authorizations (access for communication)
• Api Docs Definitions (how to communicate)
I/O State is data directly related to a request/response, normally
separated from functionality. Handles all data associated with
communication and communication access
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Does IO State Contain
•Data specifically related to I/O (request/response); not data related to
function (ie, errors, how to process, etc).all the data contained in
annotations act as rules associated with the URI endpoint (not URL or
the FQDN)
•by containing all those rules in one file and caching that data, we can
share it with the other architectural components (and abstract data from
functionality)
•this enables us to change it on the fly and reload without having to
restart any services allowing subscribed services to get changes
pushed to them through web hooks
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
I/O State : Communications Properties
Shared I/O State is ‘IO State’ data unbound from
functionality so that it can be shared across architectural
components. This is the approach used by distributed
architectures.
Bound I/O State is ‘I/O State’ data bound to functionality
which cannot be shared or synchronized with additional
architectural components creating an ‘architectural cross
cutting concern’. This is commonly found in centralized
architectures.
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
So How Do We Fix?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Shared I/O State
• DOESN’T bind to the application
• DOESN’T bind to functionality
• DOESN’T bind to a resource
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Does It Look Like?
Title Text
https://gist.github.com/orubel/7c4d0290c7b8896667a3
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• RAML, OpenAPI, Swagger, API BluePrint
• not role based; endpoints need to be checked via token roles
• limited to CRUD-based REST of 4 calls per class
• duplicitous; lack of separation
• Confuses API data with functionality
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Dramatic Code reduction By Reducing Duplication
• Automation of nearly all aspects of API
• 0% downtime for changes to endpoint data and rules
• New API Patterns (ie API Chaining (tm) )
What Does It Improve?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Code Reduction (1 of 2)
Controller : Mixed Concerns (Duplication)
@Secured(['ROLE_ADMIN', ‘ROLE_USER'])
@RequestMapping(value="/create", method=RequestMethod.POST)
@ResponseBody
public ModelAndView createAddress(){
List authorities = springSecurityService.getPrincipal().getAuthorities()
User user
if(authorities.contains(‘ROLE_ADMIN’)){
if(params.id){
user = User.get(params.id.toLong())
}else{
render(status:HttpServletResponse.SC_BAD_REQUEST)
}
}else if(authorities.contains(‘ROLE_USER’)){
user = User.get(principal.id)
}
Address address = new Address(params)
…
address.user = user
…
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Code Reduction (2 of 2)
Controller : Single Concern
public ModelAndView createAddress(){
User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id)
Address address = new Address(params)
address.user = user
…
}
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This allows for new Patterns like
API Chaining™…
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Post Chain
• GET > GET > (PUT/POST/DELETE)
• Pre Chain
• (PUT/POST/DELETE) > GET > GET
• Blank Chain
• GET > GET > GET
Three types of Chains
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What data is sent for a chain
API Chain Data
{
<put/post data (if applicable)>,
chain:{
key:dept_id,
combine:'false',
type:'postchain',
order:{dept/show:company_id,company/update:return}
}
}
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Chain Examples
GET Chain Example
PUT Chain Example
curl -v -i -H "Content-Type: application/json" -H "Authorization: Bearer <token>" --request
PUT -d "
{'testdata':'testamundo','chain':{'key':'sectionId','combine':'false','type':'postchain','order':
{'section/get':'id','section/update':'return'}}}" "http://localhost:8080/c0.1/post/show/1"
curl -v -i -H "Content-Type: application/json" -H "Authorization: Bearer <token>" --request
GET -d "
{'chain':{'key':'Id','combine':'false','type':'blankchain','order':{'postTopic/
showByTopic':'postId','post/show':'return'}}}" "http://localhost:8080/c0.1/topic/show/1"
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
More documentation on API Chaining
API Chaining™ Documentation
http://orubel.github.io/Beapi-API-Framework/chain.html
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
DEMO
RestFest 2017
orubel@gmail.comOwen Rubel
Questions?
(please contact for business opportunities or hiring)

More Related Content

What's hot

CQRS and event sourcing
CQRS and event sourcingCQRS and event sourcing
CQRS and event sourcingJeppe Cramon
 
API First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelineAPI First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelinePronovix
 
Publishing and delivery of mobile application ios
Publishing and delivery of mobile application   iosPublishing and delivery of mobile application   ios
Publishing and delivery of mobile application iosK Senthil Kumar
 
마이크로서비스 개요
마이크로서비스 개요마이크로서비스 개요
마이크로서비스 개요Younghun Yun
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityMatt Tesauro
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Managementjeremysbrown
 
API Test Automation
API Test Automation API Test Automation
API Test Automation SQALab
 
Azure Service Bus
Azure Service BusAzure Service Bus
Azure Service BusBizTalk360
 
Mock Server Using WireMock
Mock Server Using WireMockMock Server Using WireMock
Mock Server Using WireMockGlobant
 
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf정민 안
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile AppsSauce Labs
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST APIIvan Katunou
 

What's hot (20)

CQRS and event sourcing
CQRS and event sourcingCQRS and event sourcing
CQRS and event sourcing
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
API First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipelineAPI First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipeline
 
Publishing and delivery of mobile application ios
Publishing and delivery of mobile application   iosPublishing and delivery of mobile application   ios
Publishing and delivery of mobile application ios
 
마이크로서비스 개요
마이크로서비스 개요마이크로서비스 개요
마이크로서비스 개요
 
Rest assured
Rest assuredRest assured
Rest assured
 
Effective API Design
Effective API DesignEffective API Design
Effective API Design
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API Security
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
Azure Service Bus
Azure Service BusAzure Service Bus
Azure Service Bus
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Mock Server Using WireMock
Mock Server Using WireMockMock Server Using WireMock
Mock Server Using WireMock
 
API testing - Japura.pptx
API testing - Japura.pptxAPI testing - Japura.pptx
API testing - Japura.pptx
 
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile Apps
 
API Presentation
API PresentationAPI Presentation
API Presentation
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
 

Similar to Api chaining(tm)

Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST AssuredTO THE NEW Pvt. Ltd.
 
Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Fwdays
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET Journal
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol BuffersMatt O'Keefe
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIPankaj Bajaj
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionGlenn Antoine
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsFlorian Dutey
 
OFC2016 SDN Framework and APIs
OFC2016 SDN Framework and APIsOFC2016 SDN Framework and APIs
OFC2016 SDN Framework and APIsDeborah Porchivina
 
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...cscpconf
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web DevelopmentSonia Simi
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restfultom_li
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it mattersKim Clark
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsSteve Speicher
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Jackson F. de A. Mafra
 

Similar to Api chaining(tm) (20)

Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
 
Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API"
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applications
 
OFC2016 SDN Framework and APIs
OFC2016 SDN Framework and APIsOFC2016 SDN Framework and APIs
OFC2016 SDN Framework and APIs
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...
MIGRATION OF AN OLTP SYSTEM FROM ORACLE TO MYSQL AND COMPARATIVE PERFORMANCE ...
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web Development
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restful
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it matters
 
Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 
Ruby on rails RAD
Ruby on rails RADRuby on rails RAD
Ruby on rails RAD
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Api chaining(tm)

  • 1. RestFest 2017 orubel@gmail.comOwen Rubel API Chaining™ & API Abstraction
  • 2. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What is API Chaining™? “ API Chaining is a monad allowing a series of api calls to be passed and processed using one REQUEST/RESPONSE.”
  • 3. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Abstraction of Communication Logic/Data from Biz Logic • Internal Redirect Handling in API Service • Separated Communication Data from Communication Logic Requirements for API Chaining™
  • 4. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Understanding API Abstraction
  • 5. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “ An API is Standardized Input/Output (I/O) to/from a Separation of Concern (usually being Business Logic).” In Short : What Is An API? (1 OF 2)
  • 6. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Is An API? (2 OF 2) owenr@uw.edu
  • 7. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Is Separation of Concern? (2 of 2) Bound Secondary Concern (Communication Logic) Primary Concern (Business Logic)
  • 8. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “ In computer science, separation of concerns (SoC) is a design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. A concern is a set of information that affects the code of a computer program” (ex HTML, CSS, JS) - Source : Separation Of Concern, Wikipedia What Is Separation of Concern?
  • 9. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture
  • 10. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture
  • 11. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture
  • 12. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “Cross-cutting concerns can be directly responsible for tangling, or system inter-dependencies, within a program. Because procedural and functional language constructs consist entirely of procedure calling, there is no semantic through where two goals (the capability to be implemented and the related cross- cutting concern) can be addressed simultaneously.[3] As a result, the code addressing the cross-cutting concern must be scattered, or duplicated, across the various related locations, resulting in a loss of modularity.[2]” - Source : Cross Cutting Concern, Wikipedia What is a Cross Cutting Concern?
  • 13. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Synchronization • Real-time constraints • Error detection and correction • Product features • Memory management • Data validation • Persistence • Transaction processing • Internationalization and localization which includes Language localisation • Information security • Caching • Logging • Monitoring • Business rules • Code mobility • Domain-specific optimizations Issues of a Cross Cutting Concern
  • 14. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This is The API Patterns Brick Wall Brick Wall
  • 16. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Old API Pattern in MVC redirect/response
  • 17. Title Text RestFest 2017 orubel@gmail.comOwen Rubel New API Pattern in MVC
  • 18. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Shared I/O State In Distributed Architecture
  • 19. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This handles the Redirect and allows communication to take place internally when needed…
  • 20. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This allows: • Central Piece of architecture (where REQUEST AND RESPONSE are handled) to be ‘Single Version of Truth’ (SOV) called ‘IO State’ • All services can sync data from SOV • Failure of SOV DOES NOT affect synchronization of data • Reload state on the fly at SOV and update ALL subscribed services Shared IO State
  • 21. Title Text RestFest 2017 orubel@gmail.comOwen Rubel So What Is IO State?
  • 22. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What is IO State? • Caches Communications Data • Synchronizes Architectural Props (distribute rules of communication) • Handles API Authorizations (access for communication) • Api Docs Definitions (how to communicate) I/O State is data directly related to a request/response, normally separated from functionality. Handles all data associated with communication and communication access
  • 23. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Does IO State Contain •Data specifically related to I/O (request/response); not data related to function (ie, errors, how to process, etc).all the data contained in annotations act as rules associated with the URI endpoint (not URL or the FQDN) •by containing all those rules in one file and caching that data, we can share it with the other architectural components (and abstract data from functionality) •this enables us to change it on the fly and reload without having to restart any services allowing subscribed services to get changes pushed to them through web hooks
  • 24. Title Text RestFest 2017 orubel@gmail.comOwen Rubel I/O State : Communications Properties Shared I/O State is ‘IO State’ data unbound from functionality so that it can be shared across architectural components. This is the approach used by distributed architectures. Bound I/O State is ‘I/O State’ data bound to functionality which cannot be shared or synchronized with additional architectural components creating an ‘architectural cross cutting concern’. This is commonly found in centralized architectures.
  • 26. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Shared I/O State • DOESN’T bind to the application • DOESN’T bind to functionality • DOESN’T bind to a resource
  • 27. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Does It Look Like? Title Text https://gist.github.com/orubel/7c4d0290c7b8896667a3
  • 28. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • RAML, OpenAPI, Swagger, API BluePrint • not role based; endpoints need to be checked via token roles • limited to CRUD-based REST of 4 calls per class • duplicitous; lack of separation • Confuses API data with functionality
  • 29. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Dramatic Code reduction By Reducing Duplication • Automation of nearly all aspects of API • 0% downtime for changes to endpoint data and rules • New API Patterns (ie API Chaining (tm) ) What Does It Improve?
  • 30. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Code Reduction (1 of 2) Controller : Mixed Concerns (Duplication) @Secured(['ROLE_ADMIN', ‘ROLE_USER']) @RequestMapping(value="/create", method=RequestMethod.POST) @ResponseBody public ModelAndView createAddress(){ List authorities = springSecurityService.getPrincipal().getAuthorities() User user if(authorities.contains(‘ROLE_ADMIN’)){ if(params.id){ user = User.get(params.id.toLong()) }else{ render(status:HttpServletResponse.SC_BAD_REQUEST) } }else if(authorities.contains(‘ROLE_USER’)){ user = User.get(principal.id) } Address address = new Address(params) … address.user = user …
  • 31. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Code Reduction (2 of 2) Controller : Single Concern public ModelAndView createAddress(){ User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id) Address address = new Address(params) address.user = user … }
  • 32. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This allows for new Patterns like API Chaining™…
  • 33. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Post Chain • GET > GET > (PUT/POST/DELETE) • Pre Chain • (PUT/POST/DELETE) > GET > GET • Blank Chain • GET > GET > GET Three types of Chains
  • 34. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What data is sent for a chain API Chain Data { <put/post data (if applicable)>, chain:{ key:dept_id, combine:'false', type:'postchain', order:{dept/show:company_id,company/update:return} } }
  • 35. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Chain Examples GET Chain Example PUT Chain Example curl -v -i -H "Content-Type: application/json" -H "Authorization: Bearer <token>" --request PUT -d " {'testdata':'testamundo','chain':{'key':'sectionId','combine':'false','type':'postchain','order': {'section/get':'id','section/update':'return'}}}" "http://localhost:8080/c0.1/post/show/1" curl -v -i -H "Content-Type: application/json" -H "Authorization: Bearer <token>" --request GET -d " {'chain':{'key':'Id','combine':'false','type':'blankchain','order':{'postTopic/ showByTopic':'postId','post/show':'return'}}}" "http://localhost:8080/c0.1/topic/show/1"
  • 36. Title Text RestFest 2017 orubel@gmail.comOwen Rubel More documentation on API Chaining API Chaining™ Documentation http://orubel.github.io/Beapi-API-Framework/chain.html
  • 38. RestFest 2017 orubel@gmail.comOwen Rubel Questions? (please contact for business opportunities or hiring)