Versions Compared

Key

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

...

Let's look at a simple scenario that deals with aggregation of XML data from different sources. This demo didn't make it into the V1.0 Tuscany SCA release but it should is expected to be in a future release. The business function here calculates the total value of all the accounts (checking, saving and stock) that a customer owns.

1) Use an RSS feed to retrieve the currency exchange rates from the web and exact the rate for a given currency.
2) Load the account data for a customer from a an XML file or database.
3) Invoke a live web service to get the quotes for a list of symbols.
4) Calculate of the total value by joining the XML data from 2 and 3.

In this case, data are loaded/received from various data sources and manipulated as XML.

Databindings (XML, SDO, JAXB, JSON ...)

Business data are represented in As business data may be represented in many different ways even they are for the same infoset Tuscany SCA provides a number of different databindings . For example, we can model a Customer business object as:

    • JavaBeans
    • SDO
    • JAXB
    • XMLBeans
    • DOM

And different Different protocol implementation stacks also support different data representations. For example, in the Web Service domain, we have:

...

Implementation technologies may also impose requirements on the data too. For example,

...

Application developers should have the freedom to choose their preferred data representation and components with compatible data should be able to interoperate without the intervention of the business logic. With the ability to attach data transformation mediations to wires, this actually becomes a requirement to support any data type that can be mapped from client to provider and back again.

Implementation/binding types for data access and data manipulation

    • implementation.xquery
      XML is most popular data representation in SOA world. XQuery is becoming the most applicable language for extracting and transforming data from any source that can be represented as a phsical or logical XML document. Its SQL-like syntax is relatively easy to learn and it already has a role in SOA for extracting and transforming data. The XQuery implementation type brings the power of XQuery and SCA together. With the help of the databinding framework, we can use the XQuery to mediate data from many services and we also extend the XQuery capability by invoking other SCA components.

without being driven by the above concerns. Tuscany SCA provides suitable data transformation mediations which are attached automatically the wires between components to take account of the difference choices that the component developer and deployer may make.

In the sample here the exchange rate is retrieved (step 1) using the feed binding (binding.rss) as follows.

Code Blockcode
    <component name="StockValueExchangeRate">
        <tuscany:implementation<implementation.xqueryjava locationclass="stockbigbank.xqExchangeRateImpl" />
    </component>
    • implementation.data and implementation.das

...

    <reference name="

...

exchangeRate">
          

...

  <tuscany:binding.rss
                uri="http://

...

ansuz.sooke.

...

bc.

...

ca/rippy/exchange/?M=R&amp;B=USD&amp;F=CAD,CNY,EUR&amp;T=F&amp;S=O&amp;I=S" />
        

...

</reference>
    </component>

Step 3 uses the web service binding (binding.ws) to retrieve stock from the internet.

Code Block

    <reference name="

...

StockQuoteReference"

...

 promote="AccountService/stockQuote">
        <binding.ws wsdlElement="http://swanandmokashi.com#wsdl.port(StockQuotes/StockQuotesSoap)" />
    

...

</reference>

The various XML data are joined together using XQuery (implementation.xquery) in step4. XML is most popular data representation in the SOA world. XQuery is becoming the most applicable language for extracting and transforming XML data. Its SQL-like syntax is relatively easy to learn. The XQuery implementation type brings the power of XQuery and SCA together. With the help of the databinding framework, we can use the XQuery to mediate data from many services and the capability of an XQuery can be extended by invoking other SCA components.

Code Block

    <component name="StockValue">
       

...

 <tuscany:implementation.xquery location="stock.xq" />
    </component>

Assembling and Deploying Tuscany Solutions - Simon

...