SOA Patterns: New Insights Or Recycled Knowledge?

Transcription

Gregor Hohpe: SOA PatternsSOA Patterns:New Insights or RecycledKnowledge?Gregor HohpeSoftware Engineerwww.eaipatterns.com 2007 Google, Inc. All rights reserved,Could It Be So Easy?WSDLSOAPInt MyMethod(String text){ }WebMethodCutCopyPasteWS-* Buzzword compliant, but not a service-orientedarchitecture Synchronous call stack mentality No interface-implementation separation 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices21

Gregor Hohpe: SOA PatternsSOA on Architect's ct’s Dream” 2007 Google, Inc. All rights reserved,3SOA on Developer's mentEvent-basedMapping tProcessModeling Developer’s Nightmare” 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices42

Gregor Hohpe: SOA PatternsService-oriented architecturesinvolve a variety of newprogramming models.We can expect to see arenaissance of design patterns thatcapture our experience in usingthem correctly. 2007 Google, Inc. All rights reserved,5Understanding Technology Syntax Basic language mechanism Artefact of crude input devices Constructs "Vocabulary": Objects, Classes, Interfaces, Inheritance Easily explained but no guidance on good design Principles Separation of Concerns, Open-Closed, etc. Help evaluate a solution Patterns Guidance 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices63

Gregor Hohpe: SOA PatternsPatterns Origin – C. AlexanderBED ALCOVEDesign problemBedrooms make no sense.ForcesFirst, the bed in a bedroom creates awkwardspaces around it: dressing, working, watching television,sitting, are all rather foreign to the side spaces left overaround a bed.Second, the bed itself seems more comfortable in aspace that is adjusted to it.SolutionDon't put single beds in empty rooms called bedrooms,but instead put individual bed alcoves off rooms with othernonsleeping functions, so the bed itself becomes a tinyprivate haven. 2007 Google, Inc. All rights reserved,7Design Patterns “Mind sized” chunk of information(Ward Cunningham) Human-to-human communication Expresses intent (the “why” vs. the “how”) Observed from actual experience Not a firm rule Not copy-paste code 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices84

Gregor Hohpe: SOA PatternsDesign Patterns in Software Development Substitute for industry standard vocabulary "Soft" around the edges Guide in the absence of strict rules Subject to hype cycle: "pattern" "credible" 2007 Google, Inc. All rights reserved,910 Years After GoF -- Why Revisit Patterns? New programming models bring new patterns. Patterns are expressed using the constructs ofthe underlying architectural style (e.g. OO, SOA). Good to document our knowledge when not allkinks are worked out yet. Patterns help discover higher levels ofabstraction. Ultimately, some patterns can be implemented inthe platform. 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices105

Gregor Hohpe: SOA PatternsNew Programming Models in SOA Event-based, Asynchronous Programming Explicit state management Sequencing, timing uncertainty Declarative Programming Execution path chosen at run-time XSLT, Rules engines Object-Document Mapping Analogous to O-R mapping: subtle, but important Process Modeling Many concurrent, long-running instances No two-phase-commit style transactions Protocol Design 2007 Google, Inc. All rights reserved,11“Doodleware” Only Limited Help Example Graphical process editors Graphical transformation editors We love pictures Programming in pictures tedious Scalability issues“EAI Art” Diff, Merge mostly unsupported Often a thin veneer over a complex(or unfamiliar) programming paradigm 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices126

Gregor Hohpe: SOA PatternsNew Patterns in SOA Asynchronous Messaging Patterns Conversation Patterns Orchestration Patterns Process / Workflow Patterns Endpoint Patterns Security Patterns Architectural Patterns 2007 Google, Inc. All rights reserved,13Async. Messaging Patterns Components communicatevia message exchanges Simplified interaction model Compose solutions out ofrouting, transformation elements www.eaipatterns.com 65 patterns Java, C#, Axis, JMS, MSMQ, TIBCO, BizTalk 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices147

Gregor Hohpe: SOA PatternsMessaging Pattern LanguageMessageR outingMessageConstructionMessage RouterContent-Based RouterMessage FilterDynamic FilterRecipient ListSplitterAggregatorResequencerComposed Msg. Processor.Scatter-GatherRouting SlipProcess ManagerMessage BrokerMessageCommand MessageDocument MessageEvent MessageRequest-ReplyReturn AddressCorrelation IdentifierMessage SequenceMessage ExpirationFormat IndicatorMessageTransformationMessage TranslatorEnvelope WrapperContent EnricherContent FilterClaim CheckNormalizerCanonical Data elTranslatorApplicationABMessagingEndpointsMessage EndpointMessaging GatewayMessaging MapperTransactional ClientPolling ConsumerEvent-Driven ConsumerCompeting ConsumersMessage DispatcherSelective ConsumerDurable SubscriberMessaging AdapterIdempotent ReceiverService ActivatorMessagingChannelsMessage ChannelPoint-to-Point ChannelPublish-Subcr. ChannelDatatype ChannelInvalid Message ChannelDead Letter ChannelGuaranteed MessagingChannel AdapterMessaging BridgeMessage BusMonitoringS ystemsManagementControl BusDetourWire TapMessage HistoryMessage StoreSmart ProxyTest MessageChannel Purger 2007 Google, Inc. All rights ateStateInternalInternal rInvoicePaymentDrinksInternalInternal State:State:WaitingWaiting forforPaymentPaymentInternalInternal State:State:MakingMaking DrinksDrinks A process supports the desired exchange ofmessages through send and receive activities Each conversation corresponds to one processinstance Each participant has a (potentially different) processdefinition 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices168

Gregor Hohpe: SOA PatternsConversation PatternsDiscoveryDiscoveryMulti-PartyMulti-Party ConversationsConversationsDynamicDynamic DiscoveryDiscoveryConsultConsult gentContingent RequestsRequestsReachingReaching AgreementAgreementLeaderLeader ElectionElectionEstablishingEstablishing aa ConversationConversationThree-wayThree-way HandshakeHandshakeAcquireAcquire TokenToken FirstFirstRotateRotate TokensTokensAddressAddress VerificationVerificationReachingReaching AgreementAgreementReceiverReceiver CancelsCancelsSenderSender CancelsCancelsBindingBinding RequestRequestBindingBinding OfferOfferBasicBasic onseRequest-Response withwith NotifyQuickQuick AcknowledgmentAcknowledgmentResourceResource ManagementManagementLeaseLeaseRenewalRenewal ReminderReminderErrorError HandlingHandlingDoDo NothingNothingRetryRetryCompensatingCompensating ActionAction 2007 Google, Inc. All rights reserved,17Process Patterns Long-running processes Multiple instances of a process template Orchestration process across multiple servicesexposed as composite service WS-BPEL (Business Process ExecutionLanguage)Orchestration describes the automatedarrangement, coordination, and management ofcomplex computer systems, middleware, andservices.--WikiPedia 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices189

Gregor Hohpe: SOA PatternsWorkflow Patterns (Subset) Exclusive Choice (XOR)A Choose one execution pathfrom many alternativesBCA Multiple Choice (OR) Choose several executionpaths from manyalternativesCBD 2007 Google, Inc. All rights reserved,19Workflow Patterns (Subset) Synchronizing Merge Merge many execution paths.Synchronize if multiple paths aretaken.ACA Multiple Merge Merge many execution paths withoutsynchronizing. Discriminator 2007 Google, Inc. All rights reserved,Wait for A and B,then executeC onceBExecute CtwiceCA Merge many execution paths withoutsynchronizing. Execute thesubsequent activity only once.Fifth International Workshop on SOA andWeb Services Best PracticesBBCExecute Conce as soon asA or B completes2010

Gregor Hohpe: SOA PatternsSeems Trivial But Support by standards can be spotty.XPDLUMLBPEL XLANG WSFL BPML WSCIParallel Split Synchronization Exclusive Choice Simple Merge Multi Choice - - --Synchronizing Merge - - --Multi Merge----- /- /-Discriminator-------Deferred Choice- - Source: www.workflowpatterns.com 2007 Google, Inc. All rights reserved,21Take-Away New architectural styles bring new patterns. Use pattern languages as design check list. Use pattern languages as catalog of options. Patterns often highlight subtleties that vendors liketo glance over. Keep us from reinventing the wheel. Patterns harvested from actual usage. We are likely to experience a pattern renaissance. Share your knowledge. 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices2211

Gregor Hohpe: SOA PatternsSOA Pattern Resources: BooksEnterprise Integration PatternsGregor Hohpe, Bobby WoolfAddison-Wesley, 2004Pattern-Oriented SoftwareArchitecture Vol.2Schmidt et alWiley, 2000Integration PatternsMicrosoft Patterns & Practices,2004Pattern-Oriented SoftwareArchitecture Vol.4Buschmann et al.Wiley, 2007Essential BusinessProcess ModelingHaveyO'Reilly, 2005SOA PatternsArnon Rotem-gal-ozManning, 2008 (?) 2007 Google, Inc. All rights reserved,23SOA Pattern Resources: On-lineIntegration nsMessaging Patternseaipatterns.comRemoting Orchestration Patternsorchestrationpatterns.comSOA Patternswww.rgoarchitects.com/SOAPatterns/Workflow Patternsworkflowpatterns.comConversation Patternsconversationpatterns.com (WIP)Service Interaction Patternsserviceinteraction.comData Integration nsWeb Service Security ns 2007 Google, Inc. All rights reserved,Fifth International Workshop on SOA andWeb Services Best Practices2412

Gregor Hohpe: SOA Patterns Fifth International Workshop on SOA and Web Services Best Practices 2 2007 Google, Inc. All righ