...
Expose services using a variety of binding technologies without changing the business logic. This allows business logic developers to build components without regard for the specifics of the particular infrastructure or network protocol to be used when the component is deployed. This application of bindings to services makes service available not only to other SCA components but to existing applications as well.
Code Block |
---|
<component name="AccountServiceComponent"> <implementation.java class="bigbank.account.AccountServiceImpl" /> <service name="AccountService"> <tuscany:binding.jsonrpc uri="/AccountJSONService" /> <binding.ws wsdlElement="http://bigbank#wsdl.port(AccountService/AccountServiceSoap)" /> <binding.sca /> </service> ... </component> |
Invoke other services using different protocols without changing the business logic. Again this shows the separation between business logic and the network protocols to be used. This application of bindings to reference show the mechanism by which an SCA component interacts with existing enterprise applications as well as other SCA components.
Code Block |
---|
<component name="AccountServiceComponent">
...
<reference name="calculatorService">
<tuscany:binding.rmi host="localhost" port="8099" serviceName="CalculatorRMIService" />
</reference>
<reference name="stockQuoteService">
<binding.ws uri="http://localhost:8081/services/StockQuoteWebService" />
</reference>
...
</component>
|
This very simple mechanism of applying applying bindings to the services and references defined by a component is at the root of SCA's ability to separate business logic from deployment concerns. It works regardless of whether the component implementation is brand new or wraps some existing business logic. It is also the mechanism by which SCA components communicate with services outside of SCA allowing the SCA approach to be introduced incrementally into an organization. , i.e. bindings can be defined such that existing applications can access SCA services or so that SCA components can access existing applications. This flexibility allows the SCA approach to be introduced incrementally into an organization.
In the XML, implementation.java indicates that the business logic of the AccountServiceComponent is written in Java. Tuscany SCA provides support for a selection of languages for building business logic, for example, XQuery, BPEL, script. The BigBank demo implements the various operations of the calculator using scripting languages. Tuscany SCA's implementation.script Tuscany SCA provides implementation.script which currently supports Javascript, Groovy, Ruby and Python. Those developers comfortable with writing browser based scripts can now provide server side component implementations also. The Tuscany Java SCA Calculator Script (samples/calculator-script) shows scripts at work. Here is a component description.
Code Block |
---|
<component name="AddServiceComponent"> <tuscany:implementation.script script="calculator/AddServiceImpl.js"/> </component> |
...