Hello there,

 

one of the aims of SCA is to separate technology integration logic from business

logic. For example, you don’t want your business logic to depend on a

webservice provider API. In Tuscany, the wiring infrastructure  is handled

by specifying a binding in the configuration, which in theory could be

switched from one communication protocol to another.

 

I wonder if not integration technologies may be so different as to make this

goal unattainable, or at least not quite attained yet in Tuscany. Consider the

case of exception handling as presented in the travelsample tutorial .

 

There is a CreditCardPayment service whose interface has been generated

from a wsdl according to JAX-WS 2.1. The generated service interface

interface contains an authorize- method that throws an

AuthorizeFault_Exception.

 

This CreditCardPayment interface is referenced by the Payment service.

Accordingly, the client code in the Payment implementation has

code like this:

 

    try

    {

      creditCardPayment.authorize( … );

    }

    catch( AuthorizeFault_Exception e )

    {

      do_something_with( e.getFaultInfo().getErrorCode() );

    }

 

Now, presumably the CreditcardPayment implementation on the service provider 
side

would really throw an AuthorizeException, which is mapped to an AuthorizeFault

in the wsdl, from which the client-side AuthorizeFault_Exception is generated.

 

Accordingly, if we switch to an ordinary Java binding, the Payment service 
would need

to reference a different interface containing an authorize-method that throws an

AuthorizeException, and the client code would look like something this:

 

    try

    {

      creditCardPayment.authorize( … );

    }

    catch( AuthorizeException e )

    {

      do_something_with( e.getErrorCode() );

    }

 

Clearly, both the referenced interface and the error handling code in the 
business logic

would need to be binding specific.

 

Does this not defeat one of the original purposes of using Tuscany SCA in the 
first place?

Or am I missing something?

 

-- Sebastian

Reply via email to