Versions Compared

Key

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

...

In an SOA environment, business service collaborations are achieved by data exchanges between service components. Business data come from different sources and they are represented in different ways. Tuscany provides a few features in the data area to facilitate the data integrations.

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

<RAYMOND: 1st Scenario, Shrink text, remove some of the xml>

In an SOA environment, business functions can be implemented in various technologies such as Java, C++, Scripting, BPEL, Spring, OSGi and XQuery. The business data can also be represented in different formats such as DOM, JAXB, SDO, AXIOM or POJO. Business services often communicate with each other on the network using various protocols such as RMI, RMI/IIOP, SOAP/HTTP, JMS, JCA, FEED and JSON-RPC. The service collaborations are achieved by data exchanges between service components. The SCA programming model defines an extension model for interface, implementation and binding types. The extensibility is essential to SOA as we need to be able to leverage and integrate all kinds of technologies. On the data side, we also need the extensibility for different formats so that we can flow any data type that is supported by both the client and the provider.

Let's look at a simple scenario that deals with aggregation of XML data from different sources. The business function is to calculate the total value of all the accounts (checking, saving and stock) that a customer owns.

Image Added

1) Use 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 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 different ways even they are for the same infoset. For example, we can model a Customer business object asBusiness data are represented in different ways even they are for the same infoset. For example, we can model a Customer business object as:

    • JavaBeans
    • SDO
    • JAXB
    • XMLBeans
    • DOM

...

Implementation/binding types for data access and data manipulation

Let's look at a simple scenario that deals with aggregation of XML data from different sources. The business function is to calculate the total value of all the accounts (checking, saving and stock) that a customer owns.

Image Removed

1) A live feed to retrieve the exchange rate (binding.feed) and use XPath to
exact the rate for a given currency. I have to use Rome API to convert the
feed as our feed binding produces Feed objects.

2) The account data for a customer is loaded from a XML file. (We can use
implementation.data once Sebastien's proposal is implemented).

3) A live Web Service invocation to get the quotes for a list of symbols.
Only XMLStreamReader is used as the input and output. (binding.ws)

4) The calculation of the total value is implemented using XQuery to join
the XML data from 2 and 3. (implementation.xquery)

    • 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.
    • implementation.data and implementation.das
    • binding.ws
    • binding.feed
    • 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.
Code Block

    <component name="StockValue
Code Block

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
    targetNamespace="http://bigbank" name="BigBank">

    <component name="AccountService">
        <implementation.java class="bigbank.AccountServiceImpl" />
        <reference name="accountData" target="AccountData" />
        <reference name="stockValue" target="StockValue" />
        <reference name="exchangeRate" target="ExchangeRate"/>
        <property name="currency">EUR</property>
    </component>

    <component name="ExchangeRate">
        <implementation<tuscany:implementation.javaxquery classlocation="bigbankstock.ExchangeRateImplxq" />
        <reference name="exchangeRate">
            <tuscany:binding.rss</component>
    • implementation.data and implementation.das
    • binding.ws
      Code Block
      
          <reference name="StockQuoteReference" promote="AccountService/stockQuote">
              <binding.ws 

...

    • wsdlElement="http://

...

    • swanandmokashi.

...

    • com#wsdl.port(StockQuotes/StockQuotesSoap)" />
      

...

    •     </reference>
      

...

    • binding.feed
      Code Block
      
          <component name="

...

    • ExchangeRate">
              <implementation.java class="bigbank.

...

    • ExchangeRateImpl" />
          

...

    •     

...

    • <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>
      

Assembling and Deploying Tuscany Solutions - Simon

...