Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The use of the SCA programming model allows the BigBank developer to decouple the process of designing and creating the scenario from infrastructure concerns. In the BigBank composite, basic units of business logic are modelled as SCA components called AccountComponent, StockQuoteComponent etc. and their business logic is implemented . Component references are wired using Java and various scripting languages. Components are assembled by wiring references to services. This relationship between component reference references and services resolves to runtime proxies when the application is deployed. Where appropriate Tuscany SCA uses dependency injection to introduce proxies into each components reference. Once all business logic is implemented, appropriate bindings are applied to references and services to indicate how the components should communicate.

The XML SCA configuration language, called Service Component Description Language (SCDL), describes all of this information about loosely coupled enterprise component integration and the bindings to be used. Since binding information can be changed in the SCDL without changing the business logic, the implementation code is not polluted with protocol handling information and furthermore can be changed during deployment without impacting the application.

The following example shows the SCDL for shows the AccountService exposed using JSONRPC (binding.jsonrpc) and WebServices (binding.ws). The service can easily be made accessible over RMI by simply adding binding.rmi.

...

This very simple mechanism of 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, i. e. bindings 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 XMLSCDL examples, 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 currently supports Javascript, Groovy, Ruby and Python. Those developers comfortable with writing scripts can now provide server side component implementations alsoin a manage consistent with other enterprise developers.

Code Block
<component name="AddServiceComponent">
    <tuscany:implementation.script script="calculator/AddServiceImpl.js"/>
</component>

...