SlideShare a Scribd company logo
1 of 51
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/constraints-api-rest-integration
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
enterprise REST
a case study
twitter:@BrandonByars!
the eight fallacies of distributed
programming
•  the network is reliable
•  latency is zero
•  bandwidth is infinite
•  the network is secure
•  topology doesn’t change
•  there is one administrator
•  transport cost is zero
•  the network is
homogenous
POX
URI Resources!
HTTP Standard
Interface!
HATEOA
S
Forcing
people to use
your links!
RPC / SOAP!
Most REST mistakes
happen over here…!
versioning
deployment
testing
service
POX
URI
HTTP
HATEOA
S
REST
a story about a billing
system...
a story about a legacy
rewrite...
dramatis
personae
dramatis
personae
order	
  
management	
  
order	
  
entry	
  
provisioning	
  
product	
  
catalog	
  
customer	
  
field	
  force	
  
management	
  
address	
  
billing	
  
inventory:	
  
physical	
  
inventory:	
  
telephony	
  
CSR	
  
UI	
  
Web	
  
Choreography...
...not orchestratio
define logical
environments
for isolation
Shared Integration VM!
Bob’s Workstation!
Order!
O1!
Product! P1!Mary’s Workstation!
Order!
O1!
Customer! C1!
Shared Integration VM!
Bob’s Workstation!
Order!
O1!
Product! P2!Mary’s Workstation!
Order!
O1!
Customer! C1!
Product! P1!
Customer! C2!
Shared Integration VM!
Bob’s Workstation!
Order!
O1!
Product! P2!Mary’s Workstation!
Order!
O1!
Customer! C1!
Product! P1!
Customer! C2!
Shared Integration VM!
Bob’s Workstation!
Order!
O1!
Product! P2!Mary’s Workstation!
Order!
O1!
Customer! C1!
Product! P1!
Customer! C2!
Bob’s Environment!
Mary’s Environment!
coordinated
deployments
order-bob:!
product:!
webServers: [s1.test.dev] !!
url: http://s1.test.dev:8000/products!
dbServer: s1.test.dev!
dbName: OrderBobProducts!
customer:!
webServers: [s1.test.dev]!
url: http://s1.test.dev:8001/customers!
dbServer: s1.test.dev!
dbName: OrderBobCustomers!
!
order-mary:!
product:!
webServers: [s1.test.dev]!
order-bob:!
product:!
webServers: [s1.test.dev] !!
url: http://s1.test.dev:8000/products!
dbServer: s1.test.dev!
dbName: OrderBobProducts!
customer:!
webServers: [s1.test.dev]!
url: http://s1.test.dev:8001/customers!
dbServer: s1.test.dev!
dbName: OrderBobCustomers!
!
order-mary:!
product:!
webServers: [s1.test.dev]!
version as a last
resort
5.13.3!
4.1.1!
Product!
Order
Entry!
UI!
Billing!
{!
"customer": {!
"firstName": "Fred",!
"LastName": "Flinstone"!
}!
}!
{!
"customer": {!
"firstName": "Fred",!
"lastName": "Flinstone"!
}!
}!
speling mistaeks
@RequestMapping(method=POST, produces=application/json)!
@ResponseBody!
public OrderResource createOrder(!
!@RequestBody Order order,!
!HttpServletResponse response!
) throws OrderException!
{!
!...!
!...!
}!
Postel’s Law
separate functional testing
from integration testing
Automated!
Tests!
Showcase! SIT! Pre-prod! Production!Commit!
2.16.1!3.0.6!3.0.6!3.1.3!3.1.11!3.1.12!
deployment pipeline
Isolated
Pipelines!
SIT! Pre-prod! Production!
2.16.1!3.0.6!3.0.6!3.1.3!Order Entry!
Billing!
Product!
UI!
4.1.1!4.1.2!4.2.0!4.2.3!
7.2.0!7.2.0!7.2.0!7.2.6!
2.1.33!2.2.0!2.2.0!2.2.5!
deployment pipelines...
Isolation
Tests!
…! …! …! …!Commit!
2.16.1!3.0.6!3.0.6!3.1.3!3.1.11!3.1.12!
early stages
stub ruthlessly
System
Under
Test!
Tests!
Stub
Server!
hand-crafted stubs
System
Under
Test!
Tests!
Stub
Server!
record and replay stubs
Real!
Dependency!
System
Under
Test!
Tests!
Stub
Server!
general purpose stubs
Stub!
Setup!
Moco: https://github.com/dreamhead/moco !
vcr: https://github.com/vcr/vcr!
!
βetamax: https://github.com/robfletcher/betamax!
!
stubby4j: https://github.com/azagniotov/stubby4j!
!
!
mountebank: http://www.mbtest.org/!
Isolation
Tests!
…! …! …! …!Commit!
2.16.1!3.0.6!3.0.6!3.1.3!3.1.11!3.1.12!
early stages
Isolation
Tests!
…! …! …! …!Commit!
2.16.1!3.0.6!3.0.6!3.1.3!3.1.11!3.1.12!
early stages
Contract
Tests!
Isolated
Pipelines!
Contract!
Tests!
Pre-prod! Production!
2.16.1!3.0.6!3.0.6!3.1.3!Order Entry!
Billing!
Product!
UI!
4.1.1!4.1.2!4.2.0!4.2.3!
7.2.0!7.2.0!7.2.0!7.2.6!
2.1.33!2.2.0!2.2.0!2.2.5!
Contract!
Tests!
Artifacts!Isolated
Pipelines!
Tests!
3.1.2!Order Entry!
Billing!
Product!
UI!
3.1.3!
Tests!
4.2.3!
7.2.6!
Tests!
2.2.5!
Contract!
Tests!
Artifacts!Isolated
Pipelines!
Tests!
3.1.3!Order Entry!
Billing!
Product!
UI!
3.1.3!
Tests!
4.2.3!
7.2.6!
Tests!
2.2.5!
7.2.6!
4.2.3!
Product!
Order
Entry!
UI!
Billing!
Contract!
Tests!
Artifacts!Isolated
Pipelines!
Tests!
3.1.3!Order Entry!
Billing!
Product!
UI!
Tests!
4.2.3!
7.2.6!
Tests!
2.2.5!
Order
Entry-3.1.3!
Billing-4.2.3!
Product-7.2.6!
UI-2.2.5!
Contract!
Tests!
Artifacts!Isolated
Pipelines!
Tests!
3.1.3!Order Entry!
Billing!
Product!
UI!
Tests!
4.2.3!
7.2.6!
Tests!
2.2.5!
[Test]	
  
public	
  void	
  ValidateProductAttributes()	
  
{	
  
	
  	
  	
  	
  var	
  url	
  =	
  UrlForTestProduct();	
  
	
  	
  	
  	
  var	
  response	
  =	
  new	
  HttpResource(url)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .ThatAccepts("application/xml")	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .Get();	
  
	
  
	
  	
  	
  	
  Assert.That(response.StatusCode,	
  Is.EqualTo(200));	
  
	
  	
  	
  	
  AssertHasXPath(response.Body,	
  "//productCode");	
  
	
  	
  	
  	
  AssertHasXPath(response.Body,	
  "//description");	
  
	
  	
  	
  	
  AssertHasXPath(response.Body,	
  "//monthlyCharge");	
  
	
  	
  	
  	
  AssertNumeric(ValueFor(response.Body,	
  "//monthlyCharge"));	
  
}	
  
use bounded contexts
to control complexity
Rates! CSR UI!
Provisioning!Finance!
Billing! Invoicing!
Marketing /!
Website!
Product!
Catalog!
data rationalization
Conway’s Law
Organizations which design
systems ... are constrained to
produce designs
which are copies of the
communication structures of these
organizations
In every organization there will
always be one person who knows
what is going on. This person must
be fired.
product!
finance!
invoice!
billing!
create!
record event!
get events!
augment!
augment!
augment!
twitter:@BrandonByars!
http://martinfowler.com/articles/enterpriseREST.html!
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/constraints
-api-rest-integration

More Related Content

More from C4Media

More from C4Media (20)

Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Enterprise Integration Using REST: A Case Study