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: ISSUE 39: Incorrect example in Java Component Implementation Spec v1.00 - Sec 1.2.4


 
A JIRA for this issue has been created:  http://www.osoa.org/jira/browse/JAVA-39
 
I'm also changing the subject line in the thread.


Von: Simon Nash [mailto:NASH@uk.ibm.com]
Gesendet: Donnerstag, 8. Mai 2008 04:50
An: sca-j@lists.oasis-open.org
Betreff: Re: [sca-j] NEW ISSUE: Incorrect example in Java Component Implementation Spec v1.00 - Sec 1.2.4


Vamsi,
I'm glad we are agreed that this usage is valid.  I think it's best to leave the example as is (apart from fixing the Impl2 error), to show that it is possible to mix unannotated and annotated properties in this way.  I'd be OK with adding brief comments to the example to clarify this.  For example:

296 /** Additional property set through a method */
297 public class Impl4 {
298 public String someProperty;  // property specified in component definition
299 public SomeService someReference;  // reference specified in component definition
300 public Impl4(String a, SomeService b) {...}
301 @Property public void setAnotherProperty(int x) {...}
302 }

    Simon

Simon C. Nash, IBM Distinguished Engineer
Member of the IBM Academy of Technology
Tel. +44-1962-815156  Fax +44-1962-818999



C Vamsi <vamsic007@in.ibm.com>

08/05/2008 12:22

To
Simon Nash/UK/IBM@IBMGB
cc
sca-j@lists.oasis-open.org
Subject
Re: [sca-j] NEW ISSUE: Incorrect example in Java Component Implementation Spec v1.00 - Sec 1.2.4





Hi Simon,

I agree with you and I do not see any problem with the text under section
8.12.  The idea behind my raising this issue is that if we get rid of the
@Property annotation in line 301 (which is line 312 under Sec 5 in
sca-javaci-draft-20070926.doc): "@Property public void
setAnotherProperty(int x) {...}" then the example will be fine and we will
not need any qualifier like "as long as either the implementation's
componentType or the SCDL component configuration specifies a property
called someProperty".

I missed to detect that incorrect Impl2 may be because I got more attached
to the @Property annotation :o)

++Vamsi


                                                                         
            Simon Nash                                                    
            <NASH@uk.ibm.com>                                            
                                                                       To
            08/05/2008 16:27          sca-j@lists.oasis-open.org          
                                                                       cc
                                                                         
                                                                  Subject
                                      Re: [sca-j] NEW ISSUE: Incorrect    
                                      example in Java Component          
                                      Implementation Spec v1.00 - Sec    
                                      1.2.4                              
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         




Vamsi,
The section number given in the chat log minutes from last week's call was
incorrect.  The correct section is Section 8.12 of the Java Common
Annotations and APIs spec.  This says the following:

1172 The @Property annotation may be used on protected or public fields and
on setter methods or on
1173 a constructor method.
1174 Properties may also be injected via public setter methods even when
the @Property annotation is
1175 not present. However, the @Property annotation must be used in order
to inject a property onto a
1176 non-public field. In the case where there is no @Property annotation,
the name of the property is
1177 the same as the name of the field or setter.

The above text says nothing about this only applying if no annotations are
present.  So this example should be fine as long as either the
implementation's componentType or the SCDL component configuration
specifies a property called someProperty.

When looking at the example code, I noticed a different problem.  The
constructor should be Impl4 not Impl2.

    Simon

Simon C. Nash, IBM Distinguished Engineer
Member of the IBM Academy of Technology
Tel. +44-1962-815156  Fax +44-1962-818999


                                                                         
C Vamsi                                                                  
<vamsic007@in.ibm.com>                                                    
                                                                       To
28/04/2008 20:17                            sca-j@lists.oasis-open.org    
                                                                       cc
                                                                         
                                                                  Subject
                                            [sca-j] NEW ISSUE: Incorrect  
                                            example in Java Component    
                                            Implementation Spec v1.00 -  
                                            Sec 1.2.4                    
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         





DESCRIPTION:
Java Component Implementation Specification v1.00 - Sec 1.2.4 - Lines 296
to 302:
296 /** Additional property set through a method */
297 public class Impl4 {
298 public String someProperty;
299 public SomeService someReference;
300 public Impl2(String a, SomeService b) {...}
301 @Property public void setAnotherProperty(int x) {...}
302 }

In this example, the presence of @Property annotation on
setAnotherProperty() results in someProperty and someReference not make
into the componentType as property and reference respectively.  Only after
removing the @Property annotation, the implementation becomes unannotated
and someProperty & anotherProperty will be computed as properties;
someReference will be computed as a reference as per section 1.2.7.

PROPOSAL: Remove @Property from line 301 so that the line reads "public
void setAnotherProperty(int x) {...}"

See
http://lists.oasis-open.org/archives/sca-j/200804/msg00050.html

++Vamsi


---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail.  You may a link to this group and all your TCs in
OASIS
at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php











Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU















Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU








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