SlideShare a Scribd company logo
What is in a Good Contract? Designing Interfaces for Distributed Systems Schalk W. Cronjé ysb33r @ gmail.com @ysb33r
Service Contract Decouples service implementation details from clients Allows clients to be developed against standardised data models and message structures Provides conditions for access Service Implementation Client Implementations
Contents Goals for service contract design
XML services
Evaluating example contracts
Security policies
TDD & Service Contracts
What makes a good contract?
Goals for Service Contract Design ©  Greco @ skiboardsonline.com
Intrinsic Interoperability which are containing Highly standardised technical contracts Shared common expressions &  data models Designed consistently
Implementation Technology Agnostic Expression without vendor-specific details
Avoid vendor lock-in within contract
Avoid implementation leakage
Federation Consistent endpoints on technical service portfolio boundary
Business & Technology Alignment Business-centric services
Express business logic in close alignment with business analysis
Production of conceptual versions before physical design
Abstraction Turn service into black box
Contract is the only official published source
Exposure of only essential information
Reusability Ability to re-use service for service composition and routing
Forces decision on granularity of service
Do one thing and do it well
Statelessness Minimise resource consumption
Defer management of state information to a better suited backend
Allows for easier load-balancing
Composability Be effective participant in a composed service irrespective of the size and complexity of the composition
Possibilities include: Direct exposure of one operation within another service
Routing of messages from one service to another
Single front-end, selected back-ends depending on operation
Maintainability & Supportability “Easy” to read contracts
Ability to fix bugs in service without affecting the contract
Operational message debugging Understanding the message flow
Reading the message on the wire might be the only way of identifying an issue
Goals for Service Contract Design Intrinsic Interoperability
Business and Technology Alignment
Implementation Technology Agnostic
Federation
Abstraction
Reusability
Composability
Maintainability
Supportability
XML Services
SOAP vs REST WSDL as contract medium more mature than WADL
SOAP-based XML Services not restricted to HTTP transports unlike REST
SOAP-based XML Services has many standards
Rest of content will concentrate on SOAP-based contracts
WS-I Profiles Defines requirements for interoperability based upon collections of specific web standards
Contracts must be designed to conform to a specific profile
Basic Profile 1.1 / 1.2
http://www.ws-i.org
XML Service Guidelines Use XML namespaces to  separate data models
version contracts Prefer SOAP document-literal contracts to rpc-literal Allows data model design to be completely decoupled from service contract in design DO NOT use rpc-encoded contracts
Four cornerstones Operations What operations are supported? Data model How is the data structured? Locations Where can this service be found? Policies What are the operational policies and contraints?
Non-functional contract aspects Non-functional aspects are attached to the message header Embedding aspects in message body forces unnecessary coupling Security aspects added via WS-Security policies
Message routing added via WS-Addressing Required in SOAP 1.2 / Basic Profile 1.2 Reliable messaging added via WS-ReliableMessaging
Exploring Contract Examples
Discussion: editNote operation Part name Data type rpc-literal contract
Discussion: editNote operation What is the meaning of 'Bean'? Why call a returned part 'return'? What is the semantical interpretation of  'edit'? Why call part of a message 'message'?
XML Message: editNote
XML Message: editNote Use of unnamed namespace
Discussion: ValidatePackage document-literal contract Message root wrapper element
XML Message: ValidatePackage
XML Message: ValidatePackage Operation is clear; in namespace of contract Re-used data model; in namespace of data model
Readability: ValidatePackage Correct usage of default namespace – should readability be a problem (positioning of xmlns declarations are implementation-dependent)
Asynchronous contract
Asynchronous Service Contract Interface implemented by service as per contract Interface to be implemented by consumer in order to receive updates (This is not  SOA eventing)
Asynchronous Routing Header http://www.w3.org/Submission/ws-addressing/
Asynchronous Reply Header
Asynchronous Reply Header MessageID from request SOAP Action as per contract MessageID from request Endpoint from ReplyTo
Adding Policy to Service Contract
Adding Policy to Service Contract Locks down operation only to use one-way channels (anonymous responses across same HTTP channel not allowed) WS-Addressing policy
Handling large files XML is not optimised for bulk binary data
Embedding binary data in XML can lead to unnecessary processing overhead in systems.
Large files should be transferred out-of-band or as attachments.
MTOM is primary means of adding attachments.
Out-of-band Transfer Operations Request location & credentials from service, upload, notify on complete
Provide location & credentials to service
MTOM in a Nutshell “Message Transfer Optimisation Mechanism” Used in conjunction with “XML-binary Optimised  Packaging” (XOP)

More Related Content

What's hot (13)

PDF
Performance Evaluation of Web Services In Linux On Multicore
CSCJournals
 
PDF
WDSOA'05 Whitepaper: SOA and the Future of Application Development
Rajesh Raheja
 
PPTX
The Middleware technology that connects the enterprise
Kasun Indrasiri
 
PDF
IBM --Enterprise messaging in the cloud
Abhishek Sood
 
PPTX
Web Services - Introduction
Martin Necasky
 
PPT
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
 
PDF
Soa Testing An Approach For Testing Security Aspects Of Soa Based Application
Jaipal Naidu
 
PDF
Design patterns in distributed system
Tom Huynh
 
PPT
SOA Security - So What?
Oliver Pfaff
 
PDF
MOM - Message Oriented Middleware
Peter R. Egli
 
PPTX
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
 
PPT
Middleware Basics
Varun Arora
 
PPTX
Web services
Akshay Ballarpure
 
Performance Evaluation of Web Services In Linux On Multicore
CSCJournals
 
WDSOA'05 Whitepaper: SOA and the Future of Application Development
Rajesh Raheja
 
The Middleware technology that connects the enterprise
Kasun Indrasiri
 
IBM --Enterprise messaging in the cloud
Abhishek Sood
 
Web Services - Introduction
Martin Necasky
 
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
 
Soa Testing An Approach For Testing Security Aspects Of Soa Based Application
Jaipal Naidu
 
Design patterns in distributed system
Tom Huynh
 
SOA Security - So What?
Oliver Pfaff
 
MOM - Message Oriented Middleware
Peter R. Egli
 
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
 
Middleware Basics
Varun Arora
 
Web services
Akshay Ballarpure
 

Similar to What is in a Good Contract? Designing Interfaces for Distributed Systems (20)

PPT
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
Jason Townsend, MBA
 
PPT
Service Oriented Development With Windows Communication Foundation 2003
Jason Townsend, MBA
 
PDF
SOA and WCF (Windows Communication Foundation) basics
Yaniv Pessach
 
PPT
WCF
Vishwa Mohan
 
PDF
Week2 cloud computing week2
Ankit Gupta
 
PPT
SOA and web services
Sreekanth Narayanan
 
PPT
webservices overview
elliando dias
 
PPTX
Service Oriented Architecture Updated Luqman
guesteb791b
 
DOCX
Rest vs soap
Naseers
 
PPTX
nptl cc video.pptx
MunmunSaha7
 
PPTX
SOA - Unit 1 - Introduction to SOA with Web Services
hamsa nandhini
 
PPT
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
fuzzyBSc
 
PPT
Session 1: The SOAP Story
ukdpe
 
PDF
Cc unit 2 updated
Dr. Radhey Shyam
 
PPTX
WCF for begineers
Dhananjay Kumar
 
PPTX
Service Oriented Architecture
Luqman Shareef
 
PPTX
Windows Communication Foundation
Vijay Krishna Parasi
 
ODP
WS-* with WCF
ppcanodehuelva
 
PDF
Web Service Extensions | Torry Harris Whitepaper
Torry Harris Business Solutions
 
PPTX
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio
 
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
Jason Townsend, MBA
 
Service Oriented Development With Windows Communication Foundation 2003
Jason Townsend, MBA
 
SOA and WCF (Windows Communication Foundation) basics
Yaniv Pessach
 
Week2 cloud computing week2
Ankit Gupta
 
SOA and web services
Sreekanth Narayanan
 
webservices overview
elliando dias
 
Service Oriented Architecture Updated Luqman
guesteb791b
 
Rest vs soap
Naseers
 
nptl cc video.pptx
MunmunSaha7
 
SOA - Unit 1 - Introduction to SOA with Web Services
hamsa nandhini
 
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
fuzzyBSc
 
Session 1: The SOAP Story
ukdpe
 
Cc unit 2 updated
Dr. Radhey Shyam
 
WCF for begineers
Dhananjay Kumar
 
Service Oriented Architecture
Luqman Shareef
 
Windows Communication Foundation
Vijay Krishna Parasi
 
WS-* with WCF
ppcanodehuelva
 
Web Service Extensions | Torry Harris Whitepaper
Torry Harris Business Solutions
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio
 
Ad

More from Schalk Cronjé (20)

PDF
DocuOps & Asciidoctor in a JVM World
Schalk Cronjé
 
PDF
DocuOps & Asciidoctor
Schalk Cronjé
 
PDF
What's new in Asciidoctor
Schalk Cronjé
 
PDF
Probability Management
Schalk Cronjé
 
PDF
Seeking Enligtenment - A journey of purpose rather than instruction
Schalk Cronjé
 
PDF
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Schalk Cronjé
 
PDF
Gradle in 45min - JBCN2-16 version
Schalk Cronjé
 
PDF
Cool Jvm Tools to Help you Test - Aylesbury Testers Version
Schalk Cronjé
 
PDF
Cool JVM Tools to Help You Test
Schalk Cronjé
 
PDF
Using the Groovy Ecosystem for Rapid JVM Development
Schalk Cronjé
 
PDF
Gradle in 45min
Schalk Cronjé
 
PDF
Basic Gradle Plugin Writing
Schalk Cronjé
 
PDF
Seeking Enligtenment - A journey of purpose rather tan instruction
Schalk Cronjé
 
PDF
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
PDF
Beyond Estimates - Probability Management
Schalk Cronjé
 
PDF
Documentation An Engineering Problem Unsolved
Schalk Cronjé
 
PDF
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
PDF
Gradle in a Polyglot World
Schalk Cronjé
 
PDF
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
PDF
Death of Agile : Welcome to Value-focused Testing
Schalk Cronjé
 
DocuOps & Asciidoctor in a JVM World
Schalk Cronjé
 
DocuOps & Asciidoctor
Schalk Cronjé
 
What's new in Asciidoctor
Schalk Cronjé
 
Probability Management
Schalk Cronjé
 
Seeking Enligtenment - A journey of purpose rather than instruction
Schalk Cronjé
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Schalk Cronjé
 
Gradle in 45min - JBCN2-16 version
Schalk Cronjé
 
Cool Jvm Tools to Help you Test - Aylesbury Testers Version
Schalk Cronjé
 
Cool JVM Tools to Help You Test
Schalk Cronjé
 
Using the Groovy Ecosystem for Rapid JVM Development
Schalk Cronjé
 
Gradle in 45min
Schalk Cronjé
 
Basic Gradle Plugin Writing
Schalk Cronjé
 
Seeking Enligtenment - A journey of purpose rather tan instruction
Schalk Cronjé
 
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
Beyond Estimates - Probability Management
Schalk Cronjé
 
Documentation An Engineering Problem Unsolved
Schalk Cronjé
 
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
Gradle in a Polyglot World
Schalk Cronjé
 
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
Death of Agile : Welcome to Value-focused Testing
Schalk Cronjé
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 

What is in a Good Contract? Designing Interfaces for Distributed Systems