SlideShare a Scribd company logo
Patterns and anti-patterns of SOAPresented by:Mohamed R. SamyTechnical Architect, MVP
What is Architecture anyway?The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships between them. The term also refers to documentation of a system's software architecture. Reference: WikipediaWhat is an architectural style? Introduction
Architectural Styles
What is an architecturesโ€™ goal?So what is SOA? A style of architecture that emphasizes standards based integration.Is it the best way? Is success guaranteed?Introduction contd.
Standards based integrationFriction free interaction/IntegrationCommunication between system componentsThe Goal of SOA
Should loose coupling be everywhere? Implicit behaviour vs. Explicit behaviourServices as an interface to business processes.(That is how we should think about a service when we design it)The Hype
Boundaries are explicitServices are autonomousServices share contract and policy not classService compatibility is determined by policyThe four Tenets of SOA
Borders are Explicit
2 Tier (VB4-5-6) vs 3-TierCom+ (Client in Egypt, Service in Mexico)In the architecture you have to know where the boundaries are.Practical Example:Egypt/ Libyan Border vs. Cairo/ AlexTheir system vs Our system (A boundary)Lessons learned:Authentication, AuthorizationCommunication overheadTENET I :Boundaries are Explicit
Services are Autonomous
Able to chooseSelf GoverningSelf sufficientFax /Telephone between ministriesWhen the computer is down, I can still get my license (Send it later by the mail)TENET II: Services are Autonomous
Services Share Schema and Contract not Class
XML not objects, specially not platform specific objects e.g. datasetsWe need to agree on 2 things:The protocolThe policyJust what is required for the service to perform itโ€™s function (Just enough validation)TENET III:Services Share Contract and Policy not Class
IT departmentPolicy like language of the system (Arabic โ€“ Russian โ€“ English)Policy like http/XML/SSL portsThe requirements for the way the conversation is to be heldE.g. WS- standards (Message encryption, which parts are encrypted, what algorithm we will use to encrypt) TENET IV: Service Compatibility is determined by Policy
To understand the patterns we must take a look at the most common anti-patternsPatterns/Antipatterns of SOA
Customer. ADD/Update/ DeleteWhy not? Is updating the address just an update or is it a business process?CRUDY interface
CustomersList.MoveNextWho holds the list?Who controls the memory?Enumeration
1.CustomerObject.Setflagfordelete2.CustomerObject. DeleteObjects should not be left in an inconsistent state between message exchanges.However, this is dangerous but not wrong.Chatty Interface
 The perfect interface for all services:XmlDocument PerformOperation(XmlDocument input)Why not? Implicit behavior versus explicit behavior.You need to know what you send specifically and be generic about what you receive (Just enough validation.)Loosey Goosey
To avoid this anti pattern ask 3 questions:1.What does the service do? 2. What data does it need to do it?3. What data does the service return?Loosey Goosey contd.
A flag called โ€œzeftโ€, โ€œmidoโ€ , โ€œsosoโ€A house of cardsWhy implicit behavior is bad
What if the service schema changes? What happens to the connected systems?Versioning contracts in .NET1.1 vs .NET2.0[OptionalField VersionAdded = 2]NicknameWhy is that important?Just Enough Validation
The patternsPatterns and Anti Patterns- Part2
PatternsDocument ProcessorIdempotent MessageReservationSome important SOA patterns
An architectural approach to creating systems built from autonomous servicesIntegration as a fore-thought rather than an after-thoughtA service is a program you interact with via message exchangesServices are built to lastAvailability and stability are criticalA system is a set of deployed services cooperating in a given taskSystems are built to changeAdapt to new services after deploymentSOA
How do you create a simple to use, well defined an interface?Pattern1: Document Processor
Changing your drivers license, Giza Authority for TrafficReal world examples
1. Start with a process2. Compose a workflow3. Start Defining your message contracts, before your objects and entities(try to be atomic- avoid chatty interface)4.Define operationsWhere to start
5. Group your operations into servicesTips: 1. Do not use platform specific types e.g. datasets.2. Decouple Internal vs. External objects3. Use TDD so you know you are thinking about the service consumer, now you know how it feels.Where to start contd.
ContextYou are building a web serviceProblemHow do you create a simple to use, well defined an interface?ForcesYour interface should Encourage document centric thinkingDefine a clear semantic in the contractPromote loose coupling through encapsulation of the implementationBe easy to consume from any platform (WS-I base profile)Represent a business process as a complete unit of workPattern1: Document Processor
Solution: Document Processorpublic	FindCustomerByCountryResponse	FindCustomersByCountry( 		FindCustomerByCountryRequest request){	// Do something....}-Encourage document centric thinking by defining a schema (XSD) for request and response messages in your project-Generate objects from your schema to simplify development-Remember this is a boundary so donโ€™t leak internals
Do not leak internal abstractions
Generate Data transfer objects
Transition at the boundary
BenefitsConsumers think about sending and receiving business documents which are naturally more granularThe boundary of the system involves conversion from internal structures to external documentsThe implementation details of the system are encapsulatedThe service is more consumable from other platforms and can evolve more easilyLiabilitiesPerformance will suffer with transfers of data from internal to external structuresResulting context
Should I use the same schema for multiple services or should each service have its own schema?Opinion: Give each service its own schemaSharing schema makes it difficult to evolve each service independently and introduces unnecessary churn for service consumersDesign Question
How do I handle duplicate messages received at my service?Pattern2: Idempotent Message
ContextYou are developing a web service for your SOAYou heard that messages should be idempotentProblemHow do you insure that messages are idempotent?ForcesYou cannot expect anything more from the sender than what the contract defines for your serviceYou are working with a transactional database system with frequent updatesIndempotent messages
Sender tags message with a request IDYour contract can specify that this is requiredYour contract cannot insist that the ID is unique across timeThe ID tags a unit of work which will be done only onceReceiver must check to see if the unit of work has already been done before doing itThen what?Solution
Option1: return a cached responseOption2: Process the message again.Option3: Throw an exceptionSolution Options
You will have to cache responses for some period of time โ€“ how long?What if the current value is different than the cached value?What if the response was an error?What if the sender sends duplicate IDs for different units of work?Option1: Return a cached response
Great for reads, what about writes?Should we withdraw $1000 from a checking account twice?Option2: Process the message again
Did the sender get the original response?How does he get the original response if you are sending him and exception?Option 3: Throw and exception
UOW ID can be a part of the request schemaImplies duplicate handling is part of the business processUOW ID can be a custom SOAP headerImplies duplicate handling is part of the message processing infrastructureCreate a schema for the SOAP headerHaving a URI for immediate sender can be helpful to detect reentrancyData changes should be traceable to a UOW IDYour cached responses may need to reflect what the response was at the time when the request was receivedSolutions
BenefitsYour service autonomy is increased by not having to rely on consumer to do the right thingYou wonโ€™t fool yourself into thinking that reliable messaging will solve this problemLiabilitiesYour service will consume potentially large amounts of durable storage caching responsesYour service will take a performance hit for cache managementPattern3: Indempotent message
How do you maintain data consistency across a long running process?Pattern3: Reservation Pattern
ContextYou are building a service oriented applicationYou have a complex business process that you want to expose to your customers with a web serviceProblemHow do you maintain data consistency across a long running process?ForcesYou cannot share a distributed transactionThe business process requires several messages to completeThe message exchange process could take anywhere from seconds to hoursReservation pattern
Reservation pattern illustratedReserve part: 49389Qty: 200Reservation ID: 14432Expires: 2004-09-15 02:43:53ZConfirm reservation: 14432 PO #49839Reservation: 14432Receipt: 29389PO #49839
Know the concepts before you write the codeSOA is not web servicesSOA is about standards based integration and friction free interaction between systemsSOA is not a silver bulletSummary
Web servicesWCFBiztalk ESBSOA Technologies
www.arcast.tv (Webcasts)www.geekswithblogs.net/Mohamed (Cool tech blog)www.msdn.com/Architecturewww.thevstsguy.com  (under construction)www.msdn.microsoft.com/practices (P&P)References:
Email: m_raafat_samy@hotmail.comFacebook@msamyContacts
Questions?
Ad

More Related Content

What's hot (20)

Soa unit iv
Soa unit ivSoa unit iv
Soa unit iv
smitha273566
ย 
Unit iii soa
Unit iii soaUnit iii soa
Unit iii soa
smitha273566
ย 
Client server computing
Client server computingClient server computing
Client server computing
jorge cabiao
ย 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
Peter R. Egli
ย 
Design patterns in distributed system
Design patterns in distributed systemDesign patterns in distributed system
Design patterns in distributed system
Tom Huynh
ย 
Large Scale Deployment of SOA-P
Large Scale Deployment of SOA-PLarge Scale Deployment of SOA-P
Large Scale Deployment of SOA-P
C2B2 Consulting
ย 
Application Architecture
Application ArchitectureApplication Architecture
Application Architecture
Lars-Erik Kindblad
ย 
What is in a Good Contract? Designing Interfaces for Distributed Systems
What is in a Good Contract? Designing Interfaces for Distributed SystemsWhat is in a Good Contract? Designing Interfaces for Distributed Systems
What is in a Good Contract? Designing Interfaces for Distributed Systems
Schalk Cronjรฉ
ย 
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep DiveWSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2
ย 
JDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented DesignJDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented Design
Hossam Karim
ย 
Object and component based middleware for distributed system development
Object and component based middleware for distributed system developmentObject and component based middleware for distributed system development
Object and component based middleware for distributed system development
ektabhalwara
ย 
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
cscpconf
ย 
ISUG SSB Lior King
ISUG SSB Lior KingISUG SSB Lior King
ISUG SSB Lior King
sqlserver.co.il
ย 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
Sridhar Reddy
ย 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
Nitish Nagar
ย 
Chat server
Chat server Chat server
Chat server
Shamali Mhatre
ย 
componenets of osb12c
componenets of osb12ccomponenets of osb12c
componenets of osb12c
TUSHAR VARSHNEY
ย 
Middleware Technologies ppt
Middleware Technologies pptMiddleware Technologies ppt
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
ย 
Client/Server Architecture By Faisal Shahzad
Client/Server Architecture By Faisal Shahzad Client/Server Architecture By Faisal Shahzad
Client/Server Architecture By Faisal Shahzad
Faisal Shehzad
ย 
Unit 02: Web Technologies (1/2)
Unit 02: Web Technologies (1/2)Unit 02: Web Technologies (1/2)
Unit 02: Web Technologies (1/2)
DSBW 2011/2002 - Carles Farrรฉ - Barcelona Tech
ย 
Soa unit iv
Soa unit ivSoa unit iv
Soa unit iv
smitha273566
ย 
Unit iii soa
Unit iii soaUnit iii soa
Unit iii soa
smitha273566
ย 
Client server computing
Client server computingClient server computing
Client server computing
jorge cabiao
ย 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
Peter R. Egli
ย 
Design patterns in distributed system
Design patterns in distributed systemDesign patterns in distributed system
Design patterns in distributed system
Tom Huynh
ย 
Large Scale Deployment of SOA-P
Large Scale Deployment of SOA-PLarge Scale Deployment of SOA-P
Large Scale Deployment of SOA-P
C2B2 Consulting
ย 
Application Architecture
Application ArchitectureApplication Architecture
Application Architecture
Lars-Erik Kindblad
ย 
What is in a Good Contract? Designing Interfaces for Distributed Systems
What is in a Good Contract? Designing Interfaces for Distributed SystemsWhat is in a Good Contract? Designing Interfaces for Distributed Systems
What is in a Good Contract? Designing Interfaces for Distributed Systems
Schalk Cronjรฉ
ย 
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep DiveWSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2Con USA 2015: WSO2 Integration Platform Deep Dive
WSO2
ย 
JDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented DesignJDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented Design
Hossam Karim
ย 
Object and component based middleware for distributed system development
Object and component based middleware for distributed system developmentObject and component based middleware for distributed system development
Object and component based middleware for distributed system development
ektabhalwara
ย 
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
NEW APPROACH TO DEVELOP THE MESSENGER APPLICATION: FROM CLIENTSERVER DESIGN T...
cscpconf
ย 
ISUG SSB Lior King
ISUG SSB Lior KingISUG SSB Lior King
ISUG SSB Lior King
sqlserver.co.il
ย 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
Sridhar Reddy
ย 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
Nitish Nagar
ย 
componenets of osb12c
componenets of osb12ccomponenets of osb12c
componenets of osb12c
TUSHAR VARSHNEY
ย 
Client/Server Architecture By Faisal Shahzad
Client/Server Architecture By Faisal Shahzad Client/Server Architecture By Faisal Shahzad
Client/Server Architecture By Faisal Shahzad
Faisal Shehzad
ย 

Viewers also liked (7)

Wizzo dutch posters
Wizzo   dutch postersWizzo   dutch posters
Wizzo dutch posters
Stratigo -
ย 
Wizzo 2010 - Typography - Logos
Wizzo 2010 - Typography - LogosWizzo 2010 - Typography - Logos
Wizzo 2010 - Typography - Logos
Stratigo -
ย 
diversity+inclusion=innovation (stryker medical)
diversity+inclusion=innovation (stryker medical)diversity+inclusion=innovation (stryker medical)
diversity+inclusion=innovation (stryker medical)
Joe Gerstandt
ย 
Mini sites presentation
Mini sites presentationMini sites presentation
Mini sites presentation
Stratigo -
ย 
Evaluation & the Consumer 5
Evaluation & the Consumer 5Evaluation & the Consumer 5
Evaluation & the Consumer 5
Jutka Czirok
ย 
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
Text100
ย 
Usii.3a notes
Usii.3a notesUsii.3a notes
Usii.3a notes
Lisa Pennington
ย 
Wizzo dutch posters
Wizzo   dutch postersWizzo   dutch posters
Wizzo dutch posters
Stratigo -
ย 
Wizzo 2010 - Typography - Logos
Wizzo 2010 - Typography - LogosWizzo 2010 - Typography - Logos
Wizzo 2010 - Typography - Logos
Stratigo -
ย 
diversity+inclusion=innovation (stryker medical)
diversity+inclusion=innovation (stryker medical)diversity+inclusion=innovation (stryker medical)
diversity+inclusion=innovation (stryker medical)
Joe Gerstandt
ย 
Mini sites presentation
Mini sites presentationMini sites presentation
Mini sites presentation
Stratigo -
ย 
Evaluation & the Consumer 5
Evaluation & the Consumer 5Evaluation & the Consumer 5
Evaluation & the Consumer 5
Jutka Czirok
ย 
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
IBM Partnercamp 2009 - Social Media Prรคsentation: Zwitschern, bloggen, "YouTu...
Text100
ย 
Ad

Similar to Patterns&Antipatternsof SOA (20)

CBSE VS SOA Presentation
CBSE VS SOA PresentationCBSE VS SOA Presentation
CBSE VS SOA Presentation
Maulik Parikh
ย 
CBSE VS SOA SJSU Presentation
CBSE VS SOA SJSU PresentationCBSE VS SOA SJSU Presentation
CBSE VS SOA SJSU Presentation
mgp1560
ย 
Delivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic ApplicationsDelivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
ย 
Delivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic ApplicationsDelivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
ย 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
ABDEL RAHMAN KARIM
ย 
Soa Taking Theory Into Real World Application
Soa Taking Theory Into Real World ApplicationSoa Taking Theory Into Real World Application
Soa Taking Theory Into Real World Application
David Linthicum
ย 
SOA vs EDA
SOA vs EDASOA vs EDA
SOA vs EDA
Jean-Jacques Dubray
ย 
Service-oriented Architecture with Respect to Reusability
Service-oriented Architecture with Respect to ReusabilityService-oriented Architecture with Respect to Reusability
Service-oriented Architecture with Respect to Reusability
Yazd University
ย 
Why Coordination And Transactions Are Key To Building An Operational Soa
Why Coordination And Transactions Are Key To Building An Operational SoaWhy Coordination And Transactions Are Key To Building An Operational Soa
Why Coordination And Transactions Are Key To Building An Operational Soa
David Linthicum
ย 
Cc unit 2 updated
Cc unit 2 updatedCc unit 2 updated
Cc unit 2 updated
Dr. Radhey Shyam
ย 
The New Enterprise Alphabet - .Net, XML And XBRL
The New Enterprise Alphabet - .Net, XML And XBRLThe New Enterprise Alphabet - .Net, XML And XBRL
The New Enterprise Alphabet - .Net, XML And XBRL
Jorgen Thelin
ย 
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
OpenBlend society
ย 
Migrating SOA
Migrating SOAMigrating SOA
Migrating SOA
Coi Xay
ย 
distributed system with lap practices at
distributed system with lap practices atdistributed system with lap practices at
distributed system with lap practices at
milkesa13
ย 
Taking A Look At Web Services
Taking A Look At Web ServicesTaking A Look At Web Services
Taking A Look At Web Services
Stacey Cruz
ย 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
lakshmi isukapally
ย 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
lakshmi isukapally
ย 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
Faren faren
ย 
RabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docxRabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docx
Shakuro
ย 
Serverless Computing and Serverless Patterns .pdf
Serverless Computing and Serverless Patterns .pdfServerless Computing and Serverless Patterns .pdf
Serverless Computing and Serverless Patterns .pdf
John Brian Ngugi Njuguna
ย 
CBSE VS SOA Presentation
CBSE VS SOA PresentationCBSE VS SOA Presentation
CBSE VS SOA Presentation
Maulik Parikh
ย 
CBSE VS SOA SJSU Presentation
CBSE VS SOA SJSU PresentationCBSE VS SOA SJSU Presentation
CBSE VS SOA SJSU Presentation
mgp1560
ย 
Delivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic ApplicationsDelivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
ย 
Delivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic ApplicationsDelivering Process-Driven, Dynamic Applications
Delivering Process-Driven, Dynamic Applications
Nathaniel Palmer
ย 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
ABDEL RAHMAN KARIM
ย 
Soa Taking Theory Into Real World Application
Soa Taking Theory Into Real World ApplicationSoa Taking Theory Into Real World Application
Soa Taking Theory Into Real World Application
David Linthicum
ย 
Service-oriented Architecture with Respect to Reusability
Service-oriented Architecture with Respect to ReusabilityService-oriented Architecture with Respect to Reusability
Service-oriented Architecture with Respect to Reusability
Yazd University
ย 
Why Coordination And Transactions Are Key To Building An Operational Soa
Why Coordination And Transactions Are Key To Building An Operational SoaWhy Coordination And Transactions Are Key To Building An Operational Soa
Why Coordination And Transactions Are Key To Building An Operational Soa
David Linthicum
ย 
Cc unit 2 updated
Cc unit 2 updatedCc unit 2 updated
Cc unit 2 updated
Dr. Radhey Shyam
ย 
The New Enterprise Alphabet - .Net, XML And XBRL
The New Enterprise Alphabet - .Net, XML And XBRLThe New Enterprise Alphabet - .Net, XML And XBRL
The New Enterprise Alphabet - .Net, XML And XBRL
Jorgen Thelin
ย 
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaลพ Juriฤ (FRI/Univerza v Ljubljani)
OpenBlend society
ย 
Migrating SOA
Migrating SOAMigrating SOA
Migrating SOA
Coi Xay
ย 
distributed system with lap practices at
distributed system with lap practices atdistributed system with lap practices at
distributed system with lap practices at
milkesa13
ย 
Taking A Look At Web Services
Taking A Look At Web ServicesTaking A Look At Web Services
Taking A Look At Web Services
Stacey Cruz
ย 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
lakshmi isukapally
ย 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
lakshmi isukapally
ย 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
Faren faren
ย 
RabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docxRabbitMQ in Microservice Architecture.docx
RabbitMQ in Microservice Architecture.docx
Shakuro
ย 
Serverless Computing and Serverless Patterns .pdf
Serverless Computing and Serverless Patterns .pdfServerless Computing and Serverless Patterns .pdf
Serverless Computing and Serverless Patterns .pdf
John Brian Ngugi Njuguna
ย 
Ad

More from Mohamed Samy (11)

Continuous Integration using TFS
Continuous Integration using TFSContinuous Integration using TFS
Continuous Integration using TFS
Mohamed Samy
ย 
Improving developer tester collaboration with microsoft visual studio 2010
Improving developer tester collaboration with microsoft visual studio 2010Improving developer tester collaboration with microsoft visual studio 2010
Improving developer tester collaboration with microsoft visual studio 2010
Mohamed Samy
ย 
Making a Career in I.T. my 2 cents :)
Making a Career in I.T. my 2 cents :)Making a Career in I.T. my 2 cents :)
Making a Career in I.T. my 2 cents :)
Mohamed Samy
ย 
Vsts 2
Vsts 2Vsts 2
Vsts 2
Mohamed Samy
ย 
Introducing Windows Azure
Introducing Windows Azure Introducing Windows Azure
Introducing Windows Azure
Mohamed Samy
ย 
Introducing Continuous Integration Using Vsts
Introducing Continuous Integration Using VstsIntroducing Continuous Integration Using Vsts
Introducing Continuous Integration Using Vsts
Mohamed Samy
ย 
Imagine cup- Architecture/Design talk
Imagine cup- Architecture/Design talkImagine cup- Architecture/Design talk
Imagine cup- Architecture/Design talk
Mohamed Samy
ย 
Whitepaper On Agile Implementation Outline
Whitepaper On Agile Implementation OutlineWhitepaper On Agile Implementation Outline
Whitepaper On Agile Implementation Outline
Mohamed Samy
ย 
Alm Cairo Code Camp
Alm Cairo Code CampAlm Cairo Code Camp
Alm Cairo Code Camp
Mohamed Samy
ย 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Mohamed Samy
ย 
Microsft Dynamics AX Introduction
Microsft Dynamics AX IntroductionMicrosft Dynamics AX Introduction
Microsft Dynamics AX Introduction
Mohamed Samy
ย 
Continuous Integration using TFS
Continuous Integration using TFSContinuous Integration using TFS
Continuous Integration using TFS
Mohamed Samy
ย 
Improving developer tester collaboration with microsoft visual studio 2010
Improving developer tester collaboration with microsoft visual studio 2010Improving developer tester collaboration with microsoft visual studio 2010
Improving developer tester collaboration with microsoft visual studio 2010
Mohamed Samy
ย 
Making a Career in I.T. my 2 cents :)
Making a Career in I.T. my 2 cents :)Making a Career in I.T. my 2 cents :)
Making a Career in I.T. my 2 cents :)
Mohamed Samy
ย 
Introducing Windows Azure
Introducing Windows Azure Introducing Windows Azure
Introducing Windows Azure
Mohamed Samy
ย 
Introducing Continuous Integration Using Vsts
Introducing Continuous Integration Using VstsIntroducing Continuous Integration Using Vsts
Introducing Continuous Integration Using Vsts
Mohamed Samy
ย 
Imagine cup- Architecture/Design talk
Imagine cup- Architecture/Design talkImagine cup- Architecture/Design talk
Imagine cup- Architecture/Design talk
Mohamed Samy
ย 
Whitepaper On Agile Implementation Outline
Whitepaper On Agile Implementation OutlineWhitepaper On Agile Implementation Outline
Whitepaper On Agile Implementation Outline
Mohamed Samy
ย 
Alm Cairo Code Camp
Alm Cairo Code CampAlm Cairo Code Camp
Alm Cairo Code Camp
Mohamed Samy
ย 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Mohamed Samy
ย 
Microsft Dynamics AX Introduction
Microsft Dynamics AX IntroductionMicrosft Dynamics AX Introduction
Microsft Dynamics AX Introduction
Mohamed Samy
ย 

Recently uploaded (20)

AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
ย 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
ย 
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
ย 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
ย 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
panagenda
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
ย 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
ย 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
ย 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
ย 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
ย 
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything โ€“ Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
ย 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
ย 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
panagenda
ย 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
ย 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
ย 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
ย 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 

Patterns&Antipatternsof SOA

  • 1. Patterns and anti-patterns of SOAPresented by:Mohamed R. SamyTechnical Architect, MVP
  • 2. What is Architecture anyway?The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships between them. The term also refers to documentation of a system's software architecture. Reference: WikipediaWhat is an architectural style? Introduction
  • 4. What is an architecturesโ€™ goal?So what is SOA? A style of architecture that emphasizes standards based integration.Is it the best way? Is success guaranteed?Introduction contd.
  • 5. Standards based integrationFriction free interaction/IntegrationCommunication between system componentsThe Goal of SOA
  • 6. Should loose coupling be everywhere? Implicit behaviour vs. Explicit behaviourServices as an interface to business processes.(That is how we should think about a service when we design it)The Hype
  • 7. Boundaries are explicitServices are autonomousServices share contract and policy not classService compatibility is determined by policyThe four Tenets of SOA
  • 9. 2 Tier (VB4-5-6) vs 3-TierCom+ (Client in Egypt, Service in Mexico)In the architecture you have to know where the boundaries are.Practical Example:Egypt/ Libyan Border vs. Cairo/ AlexTheir system vs Our system (A boundary)Lessons learned:Authentication, AuthorizationCommunication overheadTENET I :Boundaries are Explicit
  • 11. Able to chooseSelf GoverningSelf sufficientFax /Telephone between ministriesWhen the computer is down, I can still get my license (Send it later by the mail)TENET II: Services are Autonomous
  • 12. Services Share Schema and Contract not Class
  • 13. XML not objects, specially not platform specific objects e.g. datasetsWe need to agree on 2 things:The protocolThe policyJust what is required for the service to perform itโ€™s function (Just enough validation)TENET III:Services Share Contract and Policy not Class
  • 14. IT departmentPolicy like language of the system (Arabic โ€“ Russian โ€“ English)Policy like http/XML/SSL portsThe requirements for the way the conversation is to be heldE.g. WS- standards (Message encryption, which parts are encrypted, what algorithm we will use to encrypt) TENET IV: Service Compatibility is determined by Policy
  • 15. To understand the patterns we must take a look at the most common anti-patternsPatterns/Antipatterns of SOA
  • 16. Customer. ADD/Update/ DeleteWhy not? Is updating the address just an update or is it a business process?CRUDY interface
  • 17. CustomersList.MoveNextWho holds the list?Who controls the memory?Enumeration
  • 18. 1.CustomerObject.Setflagfordelete2.CustomerObject. DeleteObjects should not be left in an inconsistent state between message exchanges.However, this is dangerous but not wrong.Chatty Interface
  • 19. The perfect interface for all services:XmlDocument PerformOperation(XmlDocument input)Why not? Implicit behavior versus explicit behavior.You need to know what you send specifically and be generic about what you receive (Just enough validation.)Loosey Goosey
  • 20. To avoid this anti pattern ask 3 questions:1.What does the service do? 2. What data does it need to do it?3. What data does the service return?Loosey Goosey contd.
  • 21. A flag called โ€œzeftโ€, โ€œmidoโ€ , โ€œsosoโ€A house of cardsWhy implicit behavior is bad
  • 22. What if the service schema changes? What happens to the connected systems?Versioning contracts in .NET1.1 vs .NET2.0[OptionalField VersionAdded = 2]NicknameWhy is that important?Just Enough Validation
  • 23. The patternsPatterns and Anti Patterns- Part2
  • 25. An architectural approach to creating systems built from autonomous servicesIntegration as a fore-thought rather than an after-thoughtA service is a program you interact with via message exchangesServices are built to lastAvailability and stability are criticalA system is a set of deployed services cooperating in a given taskSystems are built to changeAdapt to new services after deploymentSOA
  • 26. How do you create a simple to use, well defined an interface?Pattern1: Document Processor
  • 27. Changing your drivers license, Giza Authority for TrafficReal world examples
  • 28. 1. Start with a process2. Compose a workflow3. Start Defining your message contracts, before your objects and entities(try to be atomic- avoid chatty interface)4.Define operationsWhere to start
  • 29. 5. Group your operations into servicesTips: 1. Do not use platform specific types e.g. datasets.2. Decouple Internal vs. External objects3. Use TDD so you know you are thinking about the service consumer, now you know how it feels.Where to start contd.
  • 30. ContextYou are building a web serviceProblemHow do you create a simple to use, well defined an interface?ForcesYour interface should Encourage document centric thinkingDefine a clear semantic in the contractPromote loose coupling through encapsulation of the implementationBe easy to consume from any platform (WS-I base profile)Represent a business process as a complete unit of workPattern1: Document Processor
  • 31. Solution: Document Processorpublic FindCustomerByCountryResponse FindCustomersByCountry( FindCustomerByCountryRequest request){ // Do something....}-Encourage document centric thinking by defining a schema (XSD) for request and response messages in your project-Generate objects from your schema to simplify development-Remember this is a boundary so donโ€™t leak internals
  • 32. Do not leak internal abstractions
  • 34. Transition at the boundary
  • 35. BenefitsConsumers think about sending and receiving business documents which are naturally more granularThe boundary of the system involves conversion from internal structures to external documentsThe implementation details of the system are encapsulatedThe service is more consumable from other platforms and can evolve more easilyLiabilitiesPerformance will suffer with transfers of data from internal to external structuresResulting context
  • 36. Should I use the same schema for multiple services or should each service have its own schema?Opinion: Give each service its own schemaSharing schema makes it difficult to evolve each service independently and introduces unnecessary churn for service consumersDesign Question
  • 37. How do I handle duplicate messages received at my service?Pattern2: Idempotent Message
  • 38. ContextYou are developing a web service for your SOAYou heard that messages should be idempotentProblemHow do you insure that messages are idempotent?ForcesYou cannot expect anything more from the sender than what the contract defines for your serviceYou are working with a transactional database system with frequent updatesIndempotent messages
  • 39. Sender tags message with a request IDYour contract can specify that this is requiredYour contract cannot insist that the ID is unique across timeThe ID tags a unit of work which will be done only onceReceiver must check to see if the unit of work has already been done before doing itThen what?Solution
  • 40. Option1: return a cached responseOption2: Process the message again.Option3: Throw an exceptionSolution Options
  • 41. You will have to cache responses for some period of time โ€“ how long?What if the current value is different than the cached value?What if the response was an error?What if the sender sends duplicate IDs for different units of work?Option1: Return a cached response
  • 42. Great for reads, what about writes?Should we withdraw $1000 from a checking account twice?Option2: Process the message again
  • 43. Did the sender get the original response?How does he get the original response if you are sending him and exception?Option 3: Throw and exception
  • 44. UOW ID can be a part of the request schemaImplies duplicate handling is part of the business processUOW ID can be a custom SOAP headerImplies duplicate handling is part of the message processing infrastructureCreate a schema for the SOAP headerHaving a URI for immediate sender can be helpful to detect reentrancyData changes should be traceable to a UOW IDYour cached responses may need to reflect what the response was at the time when the request was receivedSolutions
  • 45. BenefitsYour service autonomy is increased by not having to rely on consumer to do the right thingYou wonโ€™t fool yourself into thinking that reliable messaging will solve this problemLiabilitiesYour service will consume potentially large amounts of durable storage caching responsesYour service will take a performance hit for cache managementPattern3: Indempotent message
  • 46. How do you maintain data consistency across a long running process?Pattern3: Reservation Pattern
  • 47. ContextYou are building a service oriented applicationYou have a complex business process that you want to expose to your customers with a web serviceProblemHow do you maintain data consistency across a long running process?ForcesYou cannot share a distributed transactionThe business process requires several messages to completeThe message exchange process could take anywhere from seconds to hoursReservation pattern
  • 48. Reservation pattern illustratedReserve part: 49389Qty: 200Reservation ID: 14432Expires: 2004-09-15 02:43:53ZConfirm reservation: 14432 PO #49839Reservation: 14432Receipt: 29389PO #49839
  • 49. Know the concepts before you write the codeSOA is not web servicesSOA is about standards based integration and friction free interaction between systemsSOA is not a silver bulletSummary
  • 51. www.arcast.tv (Webcasts)www.geekswithblogs.net/Mohamed (Cool tech blog)www.msdn.com/Architecturewww.thevstsguy.com (under construction)www.msdn.microsoft.com/practices (P&P)References:

Editor's Notes

  • #27: -Think of how things were done on paperHow do we mimick that in our services?
  • #30: Internal objects can change as much as we like, External objects need to be versioned.Donโ€™t just return the internal custimer object
  • #31: Web Services Interoperability Organization (WS-I base profile) a web service standard to encourage interoperability
  • #35: Move internal object data to your external objects at the boundary
  • #45: Unit of Work