Service Oriented Architecture Service Oriented Architecture (SOA)(SOA)
Richard Godfrey CEng MBCS CITPRichard Godfrey CEng MBCS CITPArchitectArchitect
Developer & Platform GroupDeveloper & Platform GroupMicrosoftMicrosoft
[email protected]@microsoft.com
2
AgendaAgenda
Microsoft & SOAMicrosoft & SOA
SOA technology & frameworks (.Net)SOA technology & frameworks (.Net)
ImplementationImplementation
3
Aligning Business and ITAligning Business and IT
ITIT
BusinessBusiness
Business Architecture
OperationalRequirements
FunctionalRequirements
InformationRequirements
TechnologyArchitecture
ApplicationPortfolio
InformationArchitecture
Top Top DowDow
nn
BottoBottommUpUp
4
Moving to SOA: The Top-Down ApproachMoving to SOA: The Top-Down Approach
How it works:How it works:Define a business architectureDefine a business architecture
Using, for example, Microsoft’s Using, for example, Microsoft’s MotionMotion methodology methodology
Discover what services are requiredDiscover what services are required
Create service-oriented apps based on thisCreate service-oriented apps based on this
Pros:Pros:It’s elegant, clean, and sensibleIt’s elegant, clean, and sensible
Cons:Cons:It’s very difficult in most organizationsIt’s very difficult in most organizations
Getting the up-front funding and business buy-in is Getting the up-front funding and business buy-in is toughtough
Keeping up with business change is also toughKeeping up with business change is also tough
5
Moving to SOA: The Bottom-Up ApproachMoving to SOA: The Bottom-Up Approach
How it works:How it works:Build a service-oriented appBuild a service-oriented app
Then build another oneThen build another one
Next, work on central SOA issues, e.g., security and Next, work on central SOA issues, e.g., security and managementmanagement
Then build another service-oriented app . . .Then build another service-oriented app . . .
Pros:Pros:It’s the only approach that has worked in most It’s the only approach that has worked in most organizationsorganizations
Cons:Cons:It’s an inelegant, piecemeal way to address the It’s an inelegant, piecemeal way to address the problemproblem
6
SOA in One Slide – The “Message”SOA in One Slide – The “Message”
Schema
Agreements
ProgrammingLanguage
Object Model
ApplicationServer
Database
OperatingSystem
Database
OperatingSystem
ProgrammingLanguage
Object Model
ApplicationServer
YouYour
Partner
Example of a tightly coupled solutionService Oriented Architecture
Shared Memory
ProceduralParameters,
returning values
ComponentsSome self
definition eg Type Libraries
Roles and events
ObjectsVisibilityReuse
InstancesStatics
Web Services
Self describing
WSDL, Request
ResponseLocal,
w/in firewall,Machine to
machine
M to M
IPC
Global
Ubiquitous WSA
Decoupled &Self Describing
Tightly coupled
Ap
pli
cati
on
Sco
pe Development Evolution and .NETDevelopment Evolution and .NET
8
Shift To A Service-Oriented Shift To A Service-Oriented ArchitectureArchitecture
Function orientedFunction oriented
Build to lastBuild to last
Prolonged development Prolonged development cyclescycles
FromFrom ToToProcess oriented Process oriented
Build to changeBuild to change
Incrementally built and Incrementally built and deployeddeployed
Application silosApplication silos
Tightly coupledTightly coupled
Object orientedObject oriented
Known implementationKnown implementation
Orchestrated solutionsOrchestrated solutions
Loosely coupledLoosely coupled
Message orientedMessage oriented
AbstractionAbstraction
9
Services
Message ExchangePattern
describe
OperationalRequirements
enforce
Systems
composed of
Messages
exchange
is a set ofContracts
bound by
contain Schemas define structure of
governed byPolicies
have
Service OrientationService OrientationKey Concepts Key Concepts
10
PolicyPolicy
The Anatomy of a “Service”The Anatomy of a “Service”
ServiceService
StateState
SOAPSOAPMessageMessageLogicLogic
11
Services and consumers are Services and consumers are independently versioned, independently versioned, deployed, operated, and secured.deployed, operated, and secured.
Services are Services are autonomousautonomous
Data never includes behavior; Data never includes behavior; Objects with data and behavior are Objects with data and behavior are a local phenomenon.a local phenomenon.
Share schema Share schema & contract, not & contract, not
classclassCapabilities and requirements Capabilities and requirements represented by a unique public represented by a unique public name; Used to establish service name; Used to establish service suitability.suitability.
Compatibility Compatibility based on policybased on policy
Developers opt-in to consuming, Developers opt-in to consuming, exposing, and defining public-exposing, and defining public-facing service façade.facing service façade.
Boundaries Boundaries are Explicitare Explicit
The Four Tenets of Service-OrientationThe Four Tenets of Service-Orientation
12
Web Services ArchitectureWeb Services Architecture““Secure, Reliable, Transacted servicesSecure, Reliable, Transacted services””
SOAP (Logical Messaging)SOAP (Logical Messaging)
TransportsTransports
MessagingMessagingMessagingMessaging
WSDL, UDDI, InspectionWSDL, UDDI, Inspection
Quality Quality of Serviceof ServiceQuality Quality
of Serviceof Service
TransactionsTransactions
Business Business ProcessesProcessesBusiness Business ProcessesProcessesBPEL4WSBPEL4WS
TransportTransportTransportTransport
XML, EncodingXML, EncodingOther protocolsOther servicesOther protocolsOther services
CoordinationCoordination
SecuritySecurityReliableMessagingReliable
Messaging
DescriptionDescriptionDescriptionDescription
13
SOA Design IssuesSOA Design IssuesSchema definitionSchema definitionMessage definitionMessage definitionContract definitionContract definitionMessage handlingMessage handlingProcess Process managementmanagementTransaction modelTransaction modelOperational Operational compliancecomplianceException handlingException handlingMessage to Object Message to Object mappingmappingRefinement of Refinement of AnalysisAnalysis……
Contracts
Service
Service
Process
DocumentA
DocumentC-1
DocumentC-2
DocumentB
EitherC-1 or C-2
Process
14
Service Operations IssuesService Operations Issues
SecuritySecurity
Access controlAccess control
MonitoringMonitoring
ManagementManagement
QoS and SLA QoS and SLA enforcementenforcement
VersioningVersioning
ScalabilityScalability
Dealing with Dealing with unreliabilityunreliability
Exception Exception routingrouting
CachingCaching
Service
Service
Message Processing Infrastructure
Message Processing Infrastructure
Serialize
Encrypt
Sign
Deserialize
Authenticate
AuthorizeAudit
Log
Reliablemessaging
15
BizTalk Server 2004BizTalk Server 2004
Windows
Business Rules Engine
Human Workflow Services
More
Business Activity Monitoring (BAM)
Orchestrations
.NET Framework
BizTalk Server 2004 Engine
Visual Studio .NET
Orchestration DesignerHealth and Activity
Tracking (HAT)
Unifies today’s distributed technology Unifies today’s distributed technology stacksstacks
Composable functionalityComposable functionality Appropriate for use on-machine, cross Appropriate for use on-machine, cross
machine, and cross Internetmachine, and cross Internet
““The unified programming model for rapidly The unified programming model for rapidly building service-oriented applications on the building service-oriented applications on the
Windows platform”Windows platform”
WS-* interoperability with applications WS-* interoperability with applications running on other platformsrunning on other platforms
Interoperability with today’s distributed Interoperability with today’s distributed stacksstacks
Service-oriented programming modelService-oriented programming model Supports 4 tenets of service-orientationSupports 4 tenets of service-orientation Maximized developer productivityMaximized developer productivity
““Indigo” Design GoalsIndigo” Design Goals
UnificationUnification
Interoperability Interoperability & Integration & Integration
ProductiveProductiveService-Service-OrientedOriented
ProgrammingProgramming
17
class HelloService {class HelloService { [WebMethod][WebMethod] public String Hello(String Greeting) { public String Hello(String Greeting) {
X509CertificateCollection collection = new X509CertificateCollection collection = new X509CertificateCollection();X509CertificateCollection();IntPtr blob = Marshal.AllocHGlobal(Marshal.SizeOf(IntPtr blob = Marshal.AllocHGlobal(Marshal.SizeOf( typeof(CRYPTOAPI_BLOB))); typeof(CRYPTOAPI_BLOB))); IntPtr data = (IntPtr)((int)blob + IntPtr data = (IntPtr)((int)blob + Marshal.SizeOf(typeof(CRYPTOAPI_BLOB)));Marshal.SizeOf(typeof(CRYPTOAPI_BLOB)));……
SeqAckRange range = new SeqAcknRange(id, low, high );SeqAckRange range = new SeqAcknRange(id, low, high );SeqAckRange[] ranges = { range };SeqAckRange[] ranges = { range };ReliableQueue.ProcessAcks( ranges );ReliableQueue.ProcessAcks( ranges );……
hr = pITxDispenser->BeginTransaction (NULL, hr = pITxDispenser->BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, &pITransaction);&pITransaction);……
return Greeting; return Greeting; }}}}
20,379 lines 20,379 lines securitysecurity
5,988 lines5,988 lines reliable reliable
messagingmessaging
25,507 lines 25,507 lines transactionstransactions
Total lines Total lines 56,29656,296
4,442 lines 4,442 lines infrastructureinfrastructure
Productive DevelopmentProductive DevelopmentSecure, Reliable, Transacted Application Secure, Reliable, Transacted Application DevelopmentDevelopment
……Using Visual Studio .NET Using Visual Studio .NET 20032003
18
class HelloService {class HelloService { [WebMethod][WebMethod] public String Hello(String Greeting) { public String Hello(String Greeting) {
foreach ( SecurityToken tok in foreach ( SecurityToken tok in requestContext.Security.Tokens requestContext.Security.Tokens {{ X509SecurityToken token = tok as X509SecurityToken X509SecurityToken token = tok as X509SecurityToken }}
… … SeqAckRange range = new SeqAcknRange(id, low, high );SeqAckRange range = new SeqAcknRange(id, low, high ); SeqAckRange[] ranges = { range };SeqAckRange[] ranges = { range }; ReliableQueue.ProcessAcks( ranges );ReliableQueue.ProcessAcks( ranges ); … …
hr = pITxDispenser->BeginTransaction (NULL, hr = pITxDispenser->BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, &pITransaction);&pITransaction); … …
return Greeting; return Greeting; }}}}
10 lines 10 lines securitysecurity
Total lines Total lines 27,32127,321
1,804 lines 1,804 lines reliable reliable
messagingmessaging
25,507 lines 25,507 lines transactionstransactions
……Using Visual Studio .NET 2003 Using Visual Studio .NET 2003 and WSEand WSE
Productive DevelopmentProductive DevelopmentSecure, Reliable, Transacted Application Secure, Reliable, Transacted Application DevelopmentDevelopment
19
[ServiceContract(SecureChannel, SecurityMode =“Windows")][ServiceContract(SecureChannel, SecurityMode =“Windows")][Reliability(Guarantees.ExactlyOnce | Guarantees.InOrder)][Reliability(Guarantees.ExactlyOnce | Guarantees.InOrder)][ServiceContract][ServiceContract]class HelloService class HelloService { { [ServiceOperation(TransactionFlowAllowed = true)][ServiceOperation(TransactionFlowAllowed = true)] String Hello(String Greeting) String Hello(String Greeting) { { return Greeting; return Greeting; }}}}
1 line 1 line securitysecurity
1 line 1 line reliable reliable
messagingmessaging
1 line 1 line transactionstransactions
Total linesTotal lines 33
Productive DevelopmentProductive DevelopmentSecure, Reliable, Transacted Application Secure, Reliable, Transacted Application DevelopmentDevelopment
……Using Using Visual Studio 2005Visual Studio 2005 and and IndigoIndigo