Title: Tuscany Example: Modified Calculator
1Tuscany Example Modified Calculator
- Cristian Fiorentino
- cristian.fiorentino_at_intel.com
- March 9, 2007
2Intention
- Show Tuscany
- multi-language support on writing services
- different transport bindings
- simplicity on changing among services
implementations
3Scenario
- A client needs to access to simple calculator
operations , -, , / - We have different implementations of the
calculator - Java (local to client)
- Ruby (local to client)
- RMI invocation (remote)
- WS (running remotely on Tomcat)
- To distinguish among results, operations are
performed in different ways for different
languages - Java operation 2
- Ruby operation 1
- RMI operation 4
- WS operation 3
4All Changes Just into a SCDL Definition
SCDL1
Java
Component
5All Changes Just into a SCDL Definition
SCDL2
Rubi
Component
6All Changes Just into a SCDL Definition
Component
RMI
SCDL3
7All Changes Just into a SCDL Definition
Component
WS
SCDL4
8SCDL Definition (client)
- ltcomponent name"CalculatorServiceComponent"gt
- ltimplementation.java class"calculator.Calculat
orServiceImpl"/gt - ltreference name"calculatorService"gt??lt/re
ferencegt - lt/componentgt
-
Comp
_at_Reference CalculatorService calculatorService
lt!-- ltcomponent name"CalculatorComponent"
gt ltimplementation.java class"calculator.J
avaCalculator"/gt ltrbimplementation.rb
script"CalculatorImpl.rb" class"CalculatorImpl"/
gt lt/componentgt ltreference
name"CalculatorRmiService"gt
ltinterface.java interface"calculator.CalculatorSe
rvice"/gt ltrmibinding.rmi
host"localhost" port"9999" serviceName"rmiCalcu
lator"/gt lt/referencegt ltreference
name"CalculatorWSService"gt
ltinterface.wsdl xmlnswsdli"http//www.w3.org/200
6/01/wsdl-instance" interface"http//cal
culatorwsdl.interface(Calculator)"
wsdliwsdlLocation"http//calculator
wsdl/calculator.wsdl" /gt ltbinding.ws
endpoint"http//calculatorwsdl.endpoint
(CalculatorService/ CalculatorServiceSOAP11port)"
location"wsdl/calculator.wsdl" /gt
lt/referencegt --gt
91) Java Implementation
Calculator Service (interface ,-,,/)
Calculator Component
Client
Java Implementation
10SCDL Definition for Java Implementation
- ltcomponent name"CalculatorServiceComponent"gt
- ltimplementation.java class"calculator.Calculat
orServiceImpl"/gt - ltreference name"calculatorService"gt
CalculatorComponent lt/referencegt - lt/componentgt
- ltcomponent name"CalculatorComponent"gt
- ltimplementation.java class"calculator.Jav
aCalculator"/gt - lt!--rbimplementation.rb
script"CalculatorImpl.rb" class"CalculatorImpl"/
--gt - lt/componentgt
-
- lt!--
- ltreference name"CalculatorRmiService"gt
- ltinterface.java interface"calculator.Calc
ulatorService"/gt - ltrmibinding.rmi host"localhost"
port"9999" serviceName"rmiCalculator"/gt - lt/referencegt
-
- ltreference name"CalculatorWSService"gt
- ltinterface.wsdl xmlnswsdli"http//www.w3
.org/2006/01/wsdl-instance"
112) Ruby Implementation
Calculator Service (interface ,-,,/)
Calculator Component
Client
Ruby Implementation
12SCDL Definition for Ruby Implementation
- ltcomponent name"CalculatorServiceComponent"gt
- ltimplementation.java class"calculator.Calculat
orServiceImpl"/gt - ltreference name"calculatorService"gt
CalculatorComponent lt/referencegt - lt/componentgt
- ltcomponent name"CalculatorComponent"gt
- lt!--implementation.java
class"calculator.JavaCalculator"/--gt - ltrbimplementation.rb script"CalculatorIm
pl.rb" class"CalculatorImpl"/gt - lt/componentgt
- lt!--
- ltreference name"CalculatorRmiService"gt
- ltinterface.java interface"calculator.Calc
ulatorService"/gt - ltrmibinding.rmi host"localhost"
port"9999" serviceName"rmiCalculator"/gt - lt/referencegt
-
- ltreference name"CalculatorWSService"gt
- ltinterface.wsdl xmlnswsdli"http//www.w3
.org/2006/01/wsdl-instance"
133) RMI Implementation
Calculator Service (interface ,-,,/)
Calculator
client
RMI binding
Reference
14SCDL Definition for RMI
- ltcomponent name"CalculatorServiceComponent"gt
- ltimplementation.java class"calculator.Calculat
orServiceImpl"/gt - ltreference name"calculatorService"gt
CalculatorRmiService lt/referencegt - lt/componentgt
- lt!--
- ltcomponent name"CalculatorComponent"gt
- ltimplementation.java class"calculator.Jav
aCalculator"/gt - ltrbimplementation.rb script"CalculatorIm
pl.rb" class"CalculatorImpl"/gt - lt/componentgt
- --gt
- ltreference name"CalculatorRmiService"gt
- ltinterface.java interface"calculator.Calc
ulatorService"/gt - ltrmibinding.rmi host"localhost"
port"9999" serviceName"rmiCalculator"/gt - lt/referencegt
- lt!--
- ltreference name"CalculatorWSService"gt
- ltinterface.wsdl xmlnswsdli"http//www.w3
.org/2006/01/wsdl-instance"
154) WS Implementation
Calculator Service (interface ,-,,/)
Calculator
client
Web Services binding
WebAppruntime
WSDL
Reference
16SCDL Definition for WS
- ltcomponent name"CalculatorServiceComponent"gt
- ltimplementation.java class"calculator.Calculat
orServiceImpl"/gt - ltreference name"calculatorService"gtCalcul
atorWSServicelt/referencegt - lt/componentgt
- lt!--
- ltcomponent name"CalculatorComponent"gt
- ltimplementation.java class"calculator.Jav
aCalculator"/gt - ltrbimplementation.rb script"CalculatorIm
pl.rb" class"CalculatorImpl"/gt - lt/componentgt
-
- ltreference name"CalculatorRmiService"gt
- ltinterface.java interface"calculator.Calc
ulatorService"/gt - ltrmibinding.rmi host"localhost"
port"9999" serviceName"rmiCalculator"/gt - lt/referencegt
- --gt
-
- ltreference name"CalculatorWSService"gt
17WS/RMI Calculator Implementation
Zoom In
Calculator
-
/
Calculator Service (interface ,-,,/)