Hi Florian

On Tue, Aug 31, 2010 at 9:59 AM, Florian MOGA <[email protected]> wrote:
> Hi Ant,
> It seems I've missed Simon's commit and didn't update jsonp binding sources
> at the time I was checking them out... That was the problem I wanted to
> bring up. I've checked up the new getJSONRequestStringArray() method and
> I've spotted that the typesIndex is never incrementing... Can't estimate
> what's the impact of not having quotes for all string objects in JSON and if
> this is handled the right way by the databinding layer, maybe Simon can give
> us more details?

It may just be an error. Let me take a look.

> Looking at the code, I find the abstraction very useful and I would like to
> use this databinding layer for the comet binding too so we can have
> conversions done in one place. All that's required for parameters is to pass
> the string array as a Object[] type and tuscany will take care of everything
> else? How is it working actually? Are the objects passed through another
> layer that takes care of conversions before making the service call?

Yes, where the type of the interface contract at the binding and the
implementation differ the Tuscany runtime (see
DatabindingRuntimeWireProcessor in modules/core-databinding) adds a
DataTrasnformationInterceptor to the wire. On the service side this
interceptor converts the type of the data coming in from the binding
into the data types expected by the implementation. If you look at the
separate databindings you can see the individual transformers, for
example, in databinding-json you can see a JSON2JavaBean transformer
which, well, converts a JSON object into a JavaBean. The same thing
can happen on references too but in the opposite direction of course.

The configuration and processing of databindings is all a bit
complicated as it's very flexible. It's also complicate as it deals
with wrapping/unwrapping data types as appropriate depending on the
style of WSDL that's used to describe an interface. The best way to
understand it is to:

- take a look at Raymond's presentation on the subject  [1]
- debug through a running example

> I can also see that the tuscany-databinding-json artifact is used in
> binding-jsonp-runtime only with test scope. Does this mean every project
> using jsonp binding needs to declare tuscany-databinding-json as a
> dependency as well or tuscany will fail json conversion? Wouldn't that try
> to convert all the objects passed in the service calls made in the
> composite?

We should make this a runtime dependency

...snip


[1] 
http://www.google.co.uk/url?sa=t&source=web&cd=5&ved=0CCgQFjAE&url=http%3A%2F%2Fsvn.apache.org%2Frepos%2Fasf%2Ftuscany%2Fsandbox%2Fold%2Fdoc%2Ftuscany.databinding.ppt&ei=Kcl8TJ2aEMyNjAeYte3TDg&usg=AFQjCNHXxhplX1P3r6OA8IoJXhWAsM39uA&sig2=1521aoFfCJ9FcWOMeydH_A

I just found the above link via a Google search. I'm sure it's
referenced from the web site but I can't find it. I'm hoping Raymond
can point us at it.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to