You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2007/09/01 00:44:45 UTC

Boolean instead of boolean for autowire attributes

Hi,

I'm reviewing our support for autowiring and found out there is an issue 
with our Composite/Component/ComponentReference models.

By the assembly spec, there is difference between the following two cases:

a) <component name="C1">
b) <component name="C1" autowire="false">

Case a) will inherit the autowire from the containing composite while case 
b) will override the one from the composite.

In the current code, we use a boolean to represent the setting in 
Composite/Component/ComponentReference interface and it cannot reflect the 
null value. I propose that we make the following changes:

1) Change the method "void setAutowire(boolean autowire)" to "void 
setAutowire(Boolean autowire)". Thanks to the JDK5 autoboxing, this will not 
break any existing code.
2) Change the implementation of isAutowire() to default null value to false.
3) Add a new method to "Boolean getAutowire()" to the 
Composite/Component/ComponentReference
4) Update the CompositeProcessor and CompositeConfigurationBuilderImpl to 
read/propagate the autowire settings correctly.

I have all these changes working locally. If there's no objections, I'll 
check in the code soon.

Thanks,
Raymond 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Boolean instead of boolean for autowire attributes

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Raymond Feng wrote:
> Hi,
>
> I'm reviewing our support for autowiring and found out there is an 
> issue with our Composite/Component/ComponentReference models.
>
> By the assembly spec, there is difference between the following two 
> cases:
>
> a) <component name="C1">
> b) <component name="C1" autowire="false">
>
> Case a) will inherit the autowire from the containing composite while 
> case b) will override the one from the composite.
>
> In the current code, we use a boolean to represent the setting in 
> Composite/Component/ComponentReference interface and it cannot reflect 
> the null value. I propose that we make the following changes:
>
> 1) Change the method "void setAutowire(boolean autowire)" to "void 
> setAutowire(Boolean autowire)". Thanks to the JDK5 autoboxing, this 
> will not break any existing code.
> 2) Change the implementation of isAutowire() to default null value to 
> false.
> 3) Add a new method to "Boolean getAutowire()" to the 
> Composite/Component/ComponentReference
> 4) Update the CompositeProcessor and CompositeConfigurationBuilderImpl 
> to read/propagate the autowire settings correctly.
>
> I have all these changes working locally. If there's no objections, 
> I'll check in the code soon.
>
> Thanks,
> Raymond
>

+1, would be good to also @deprecate isAutowire then.

Are there any other boolean attributes in the model deserving a similar 
treatment?

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org