OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-j message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sca-j] NEW ISSUE: Clarify the name implied by setter method for property and reference names


Comments inline...

Jim

On Dec 12, 2008, at 5:59 AM, C Vamsi wrote:

> TARGET: sca-javaci-draft-20070926.doc
> sca-javacaa-1.1-spec-cd01-rev1.pdf
>
> DESCRIPTION:
> @Property and @Reference annotations without the name attribute  
> applied on
> setter methods require the property/reference name to be computed  
> from the
> method name.  In CAA and CI specs we mention "... name of the field or
> setter".  What happens in the following case?
>
> public class WeirdHello {
>
>    @Property
>    public void setPrefix(String prefix) {
>    ...
>    }
>
>    @Property
>    public void setprefix(String prefix) {
>    ...
>   }
>
>    @Property
>    public void setID(String id) {
>    ...
>   }
>   ...
> }
>
> There is nothing syntactically wrong with this class.  What will be  
> the
> propery names in this case?  Will setID() method result in a  
> property with
> name ID or iD ?  Is it an error?  It is not clear and we need to  
> make it
> clear.
>
> PROPOSAL: Clarify that the name implied by the setter method is the  
> name
> obtained by removing "set" from the method name.  For e.g. setID()  
> will
> result in "ID", setid() will result in "id" and setPrefix() will  
> result in
> "Prefix" not "prefix".
>
This is not correct according to JavaBeans property naming convention  
and the runtime should raise an error. Not raising an error will  
result in different property names being computed depending on the  
shape of the class (e.g. of "setprefix" were added at a later point).  
While we don't require corresponding accessors as JavaBeans does, I  
think we should be using the naming pattern as specified in Section  
8.3 of the JavaBeans Specification. Most DI frameworks do this too.

Jim

> ++Vamsi
> Apache Tuscany Committer  http://tuscany.apache.org
> Apache Geronimo Committer and Member of PMC  http:// 
> geronimo.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail.  Follow this link to all your TCs in OASIS at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]