web services: it’s distribution jim, but not as we know it
TRANSCRIPT
©© BlueSkylineBlueSkyline Ltd. 2003Ltd. 200311
Web Services: It’s distribution Jim, but not as we know it
Andy LongshawAndy [email protected]@blueskyline.com
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 22
Who am I?
Independent consultant, writer, trainer, mentorIndependent consultant, writer, trainer, mentorCoveringCovering–– .NET, J2EE, platforms, enterprise development.NET, J2EE, platforms, enterprise development–– Design and architectureDesign and architecture–– ComponentsComponents–– Web technologies, XML, B2BWeb technologies, XML, B2B
Why am I stood here?Why am I stood here?–– Architecture work including Web ServicesArchitecture work including Web Services–– Training and mentoring is part of what I doTraining and mentoring is part of what I do
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 33
Some important questions
Who am I?Who am I?Who are you?Who are you?–– Developers and technical architects who are interested in Developers and technical architects who are interested in
experience of Web Services as a distribution mechanismexperience of Web Services as a distribution mechanism
Why are you here?Why are you here?–– Learn from my mistakesLearn from my mistakes–– Examine some of the pitfalls of Web Service architecturesExamine some of the pitfalls of Web Service architectures–– Consider how these problems may be addressedConsider how these problems may be addressed
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 44
Caveat
I’m a practitioner, not an industry analystI’m a practitioner, not an industry analystThis session is based onThis session is based on–– What I’ve seenWhat I’ve seen–– The tools I’ve usedThe tools I’ve used–– What I know to be available nowWhat I know to be available nowThere may be allThere may be all--singing, allsinging, all--dancing tools out dancing tools out there that address all of the issuesthere that address all of the issues–– Well, there Well, there couldcould be…be…–– … and they might be cheap … and they might be cheap ☺☺
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 55
What is a Web Service?
Marketing vision vs. technical interoperabilityMarketing vision vs. technical interoperability–– A floor wax and a dessert toppingA floor wax and a dessert topping
Web protocolsWeb protocolsXML encodingXML encodingServiceService--oriented architectureoriented architecture
SzyperskiSzyperski Web Service definitionWeb Service definition–– “components and their operating agents”“components and their operating agents”
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 66
Web Service interaction
SOAPEndpointSOAP
Endpoint
Web Service Server
ApplicationFunctionalityApplication
Functionality
Discoverendpoint and
interface
A briefreminder
WSDLinterfaceWSDL
interface
SOAP MessagesSOAPClient
SOAPClient
Registerendpoint and
interface
Serviceregistry
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 77
Web Service as a component
What did we learn from components?What did we learn from components?–– Define the interface firstDefine the interface first
Internal implementation should be irrelevantInternal implementation should be irrelevant
–– Get the right level of granularityGet the right level of granularity–– A unit of deploymentA unit of deployment–– Do something useful (this is not a GUI widget)Do something useful (this is not a GUI widget)
How do Web Services shape up?How do Web Services shape up?
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 88
Web Service development
Most developer tools make Web Service look like RPCMost developer tools make Web Service look like RPC–– Nice, familiar paradigm but somewhat deceptiveNice, familiar paradigm but somewhat deceptive
ProtocolsProtocols–– Overhead and impedance far closer to traditional CORBAOverhead and impedance far closer to traditional CORBA–– Objects Objects vsvs XMLXML–– Data and encapsulation are lost, overhead is gainedData and encapsulation are lost, overhead is gained–– Web Services are Web Services are notnot a transparent remoting mechanisma transparent remoting mechanism
ArchitectureArchitecture–– More coarseMore coarse--grained than most RPC developments…grained than most RPC developments…–– …and potentially far more widely…and potentially far more widely--distributeddistributed
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 99
Web Service development 2Most developer tools, e.g. VS.NET, generate WSDL from codeMost developer tools, e.g. VS.NET, generate WSDL from code–– Can adjust generated WSDL if you know what you want…Can adjust generated WSDL if you know what you want…
Most developer tools generate code from WSDLMost developer tools generate code from WSDL–– Development environments don’t come with WSDL/interface editorsDevelopment environments don’t come with WSDL/interface editors–– So who writes the WSDL/XSD?So who writes the WSDL/XSD?
WSDL editors, e.g. WSDL editors, e.g. XMLSpyXMLSpy, are very good if you know WSDL, are very good if you know WSDL–– Need another layer of abstraction for “the rest of us”Need another layer of abstraction for “the rest of us”
Leans towards Web ServicesLeans towards Web Servicesbased on code artefactsbased on code artefacts
I wouldn’t start from here…I wouldn’t start from here…
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1010
Define the interface firstGeneration from code is basically flawedGeneration from code is basically flawed–– ImplementationImplementation--led, too simplistic (simple != simplistic)led, too simplistic (simple != simplistic)
Create the WSDL firstCreate the WSDL first–– Documents better than RPC for parameter flexibilityDocuments better than RPC for parameter flexibility–– Share common types (industry standard?)Share common types (industry standard?)–– If you “own” both sides make it doc/literal,If you “own” both sides make it doc/literal,
SOAP binding and forget the rest! SOAP binding and forget the rest! But, if you own both sides why bother?But, if you own both sides why bother?
WSDL isn’t perfectWSDL isn’t perfect–– Lack of semantics and preLack of semantics and pre--conditionsconditions–– WSWS--I trying to iron out the kinksI trying to iron out the kinks
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1111
Get the right granularity
CoarseCoarse--grained vs. finegrained vs. fine--grained componentsgrained components–– LongLong--running debate in CBD worldrunning debate in CBD world
What are “coarseWhat are “coarse--grained" Web Services?grained" Web Services?–– Discover components from UML modelDiscover components from UML model–– Component methodologies (e.g. Component methodologies (e.g. CheesemanCheeseman/Daniels)/Daniels)–– Expose as Web Services at network boundary?Expose as Web Services at network boundary?
Component + Web Service protocols Component + Web Service protocols == == Web Service?Web Service?Easy to generate fineEasy to generate fine--grainedgrainedWeb Service from code…Web Service from code…
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1212
Person-to-Person
ASP.NETWeb ServiceASP.NET
Web Service
Presentation Tier
ASP.NETWeb ServiceASP.NET
Web Service
BusinessLogic
BusinessLogic
BusinessLogic
BusinessLogicService Tier
ASP.NETWeb FormASP.NET
Web Form
GetCustomer PlaceOrder
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1313
A unit of distribution Spot theWeb Service?
Client Tier Middle Tier(s) Data Tier
Presentation Layer
Application
Layer
Persistence LayerThin Client
Services Layer
Dom
ain Layer
Thick ClientClient
DatabaseCluster
Presentation Layer
Application
Layer
Web Container
Application
Container ‘Legacy’SystemEJB Container
Thick ClientNetwork
boundaryNetwork
boundary
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1414
Make it meaningfulMust add some value, so what do you expose?Must add some value, so what do you expose?Data/persistence (no business logic)Data/persistence (no business logic)–– You are just a SQL Query/Update in disguise!You are just a SQL Query/Update in disguise!–– DisasterDisaster
Domain model/rulesDomain model/rules–– Possible but too finePossible but too fine--grainedgrained–– Entity Entity EJBsEJBs all over againall over again
Business logic/servicesBusiness logic/services–– Getting there but what about choreography?Getting there but what about choreography?
UI/application flowUI/application flow–– Isn’t this just to underpin HTML…Isn’t this just to underpin HTML…
Presentation
Application
Services
Domain
Persistence
Model based on Model based on “EJB Design “EJB Design Patterns” [Patterns” [EJBDEJBD]]
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1515
The application wedge
WSWSWeb Service
ClientWeb Browser
ClientUIUI
SS SS
DMDM DMDM DMDM
DADA DADA DADA DADA
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1616
Principles of the wedgeCreate a Web Service wrapper for a whole “application”Create a Web Service wrapper for a whole “application”–– Consistent, coherent representation of your business process,Consistent, coherent representation of your business process,
not just the data it usesnot just the data it usesCome in at the top and don't “cross the beams”Come in at the top and don't “cross the beams”–– Dependencies go downwards or sometimes horizontallyDependencies go downwards or sometimes horizontally–– Use 3rd party components at any level (may also be Web Services)Use 3rd party components at any level (may also be Web Services)
Can use Web Service protocols between tiers if you have to Can use Web Service protocols between tiers if you have to Coherent but flexible data passingCoherent but flexible data passing–– Define summary/details Data Transfer Objects, and/or…Define summary/details Data Transfer Objects, and/or…–– Hand out references and resolve data when it's neededHand out references and resolve data when it's needed
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1717
Web Service-based application
WS
WSWS
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1818
Resulting architecture
Authentication
Businesstransactions
Management
Other
InfrastructureWeb Services User Interface
Business/Application Logic
J2EE .NET Hardware
Low-level Infrastructure
Payment Currencyconversion
Creditchecks
ERPfunctions Other
Business Web Services
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 1919
There's a hole in my service…
SecuritySecurity–– It’s DCOM and RMI all over againIt’s DCOM and RMI all over again–– Identity (and hence payment) dependsIdentity (and hence payment) depends
on much of the same missing stuffon much of the same missing stuff
TransactionsTransactions–– It’s DCOM and RMI all over againIt’s DCOM and RMI all over again–– But it’s worse, in a real Web Service But it’s worse, in a real Web Service
VersioningVersioningQoSQoS
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 2020
When you’re dead and gone
It’s a question of who…It’s a question of who…–– …owns the Web Service after it is built?…owns the Web Service after it is built?–– …is responsible for keeping it available…is responsible for keeping it available
and scaling it?and scaling it?–– …determines which applications can use it?…determines which applications can use it?–– …is responsible for upgrading the functionality?…is responsible for upgrading the functionality?–– …keeps track of versions and dependencies?…keeps track of versions and dependencies?Who pays for the service and how?Who pays for the service and how?
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 2121
Consuming other Web Services
An extension to the architect’s artAn extension to the architect’s artSelection of 3rd party servicesSelection of 3rd party services–– Will it still be there next year?Will it still be there next year?–– What are it’s “What are it’s “ilitiesilities”?”?–– What does it cost?What does it cost?–– How do you test a shared service?How do you test a shared service?
The questions are similar whether the The questions are similar whether the service is internal or externalservice is internal or externalMitigate risk and agree Mitigate risk and agree SLAsSLAs
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 2222
Summary
Justify your use of Web ServicesJustify your use of Web ServicesDecide what is and is not really a serviceDecide what is and is not really a serviceArchitect your own services as a wedgeArchitect your own services as a wedgeFind a good WSDL editor/generatorFind a good WSDL editor/generator–– Or a WSDL expertOr a WSDL expertPlan for the ongoing life of the servicePlan for the ongoing life of the serviceSelect any 3rd party services carefullySelect any 3rd party services carefully
©© BlueSkylineBlueSkyline Ltd. 2003 Ltd. 2003 2323
Where next?See alsoSee also–– EnterpriseEnterprise--class Web Servicesclass Web Services 16:15 Tuesday16:15 Tuesday–– Middleware Integration with Web Services Middleware Integration with Web Services 09:00 Wednesday09:00 Wednesday
ReferencesReferences–– XML.comXML.com articles:articles:
WSDL Tales From The Trenches Parts 1, 2 & 3 (Johan WSDL Tales From The Trenches Parts 1, 2 & 3 (Johan PeetersPeeters))WSDL First (Will Provost)WSDL First (Will Provost)The IDL That Isn't (The IDL That Isn't (Gudgin/EwaldGudgin/Ewald))
–– Beyond Objects Beyond Objects http://http://www.sdmagazine.comwww.sdmagazine.com/beyond//beyond/–– Web Services Interoperability Web Services Interoperability http://wshttp://ws--i.orgi.org–– Tools and technologiesTools and technologies
XMLSpyXMLSpy http://http://www.altova.comwww.altova.comJ2EE Web Services J2EE Web Services http://java.sun.com/webserviceshttp://java.sun.com/webservices.NET Web Services .NET Web Services http://msdn.microsoft.com/webserviceshttp://msdn.microsoft.com/webservices