Hi, Mike.
Thank you for looking into it. Please see my comments inline.
Raymond
----- Original Message -----
From: "Mike Edwards" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, July 06, 2007 6:34 AM
Subject: Need spec defined Databindings? Was: (TUSCANY-824) DataBinding: Is
it a concern of Programming Model vs. Assembly?
Folks,
OK, finally, I bite ;-)
The question for me is whether we need the SCA (Java) spec to define some
standard metadata (typically annotations) for databindings of services &
references.
I make the assumption that for much of the time, it is possible to work
out the required databinding simply by inspection of the types of the
parameters involved. If you find an SDO object, if you find a JAXB
object, etc.
We have been trying hard to inspect the data types in order to avoid
tuscany-specific annotations. The inspections are based on different things,
for example, the DataObject interface for dynamic SDO, code pattern for
generated SDO (or we have to register generated SDO types first and do a
lookup using the java class as the key) and annotations for JAXB.
The inspection can figure out what data type is used in most cases, for
example, a SDO data object, a JAXB bean or a DOM node. Sometimes we need
additional metadata for the purpose of data transformation, for example, the
element QName for a DOM or AXIOM element.
Generally speaking, I prefer to define the standard metadata if necessary.
Then the medadata can be collected in many ways, from XML, from annotation
or from inspection.
So is the real issue the case where mixed types of data objects turn up?
Or are there ambiguous cases where you can't tell what the kind of object
is?
I agree that it's rare for an operation to use mixed types of data. There
are ambiguous cases though. One simple senario will be using
java.lang.String to represent data. In the following three operations, [1]
expects an XML string, [2] expects an plain string, and [3] expects an JSON
string. Inspection cannot tell the differences without annotations.
[1] String m1(String xmlString);
[2] String m2(String plainString);
[3] String m3(String jsonString);
I suppose that we can take two views of cases like these:
a) Don't go there, it's not valid.
b) OK, annotate your code enough to tell us exactly what you expect to
happen.
If we want to go down the second path, then I'm happy to carry back
requirements to the SCA Java WG, but I'd really like an appreciation of
just how common this case is likely to be.
Views please....
Yours, Mike.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]