Hi Raymond

Comments/questions in-line

On Thu, Jun 24, 2010 at 7:55 PM, Raymond Feng <[email protected]> wrote:
> Hi,
> I ran into two problems related to SCA property validation.
> Assuming we have the following:
>
> a) The java component impl class
> public class MyServiceImpl {
> ...
> @Property
> private String p1;
> ...}
> By intropsection, we will have "p1" as a property (xsd:string).
> b) The component definition
> <component name="MyComponent">
> <implementation.java class="test.MyServiceImpl"/>
> <property name="p1" value="xyz"/>
> </component>
> This will be reported by Tuscany as an error in two places:
> 1) We check if the property element has either @type or @element. (From the
> SCA assembly spec, if there is no type, it should use the one from the
> componentType property. My understanding is that we can have none of the
> attrs.)

You mean that Tuscany doesn't support the @type or @element annotations?

> Now if I change the property to be a JAXB complex type:
> public class MyServiceImpl {
> ...
> @Property
> private Customer p1;
> ...}
> <component name="MyComponent">
> <implementation.java class="test.MyServiceImpl"/>
> <property name="p1" type="customer:Customer"/ xmlns:customer="...">
> </component>
> 2) We also try to find an XSD definition that matches the customer:Customer
> type but I actually have that from the JAXB annotations.

Which JAXB annotations in this case?

This validation
> seems to be too much and we should be able to just check the type
> compatibility by the QName.

Won't we still want to validate that what the user has typed into the
composite file matches the expected type? I feel like I'm missing what
you mean by "this validation" in this case.

> If we agree, I can relax the code to fix these issues.
> Thanks,
> Raymond
> ________________________________________________________________
> Raymond Feng
> [email protected]
> Apache Tuscany PMC member and committer: tuscany.apache.org
> Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
> Personal Web Site: www.enjoyjava.com
> ________________________________________________________________
>

Simon

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

Reply via email to