[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [sca-j] [NEW ISSUE] Java C&I Constrctor Examples are incorrect
Simon,
When JAVA-39 was raised, I have not thought about the constructors. Now
that we require all parameters of a constructor annotated with a
@Constructor annotation to have either a @Property or a @Reference
annotation (JCA90003 in CAA spec), we need to revisit these examples.
Appears like we have to require an unannotated implementation (i.e., one
with no @Property or @Referene annotations) to have a constructor with no
parameters. I guess it will call for a new issue!!
++Vamsi
Apache Tuscany Committer �http://tuscany.apache.org
Apache Geronimo Committer and Member of PMC �http://geronimo.apache.org
Simon Nash
<oasis@cjnash.com
> To
OASIS Java
27/02/2009 20:40 <sca-j@lists.oasis-open.org>
cc
Subject
Re: [sca-j] [NEW ISSUE] Java C&I
Constrctor Examples are incorrect
I believe this is a duplicate of issue JAVA-39. However, I'd like
to understand the reason for the assertion that the examples noted as
"does not unambiguously identify all property and reference values"
are incorrect.
Simon
Mike Edwards wrote:
>
> Raiser: Mike Edwards
>
> Target: sca-javaci-1.1-spec-wd03.pdf
>
> Description:
>
> The constructor examples in section 5 contain errors that make some of
> them illegal and they must be fixed.
>
> /** Simple class taking a single property value */
>
> public class Impl1 {
>
> String someProperty;
>
> public Impl1(String propval) {...}
>
> }
>
> *<mje> This one does not "unambiguously identify all property and
> reference values"</mje>*
>
> /** Simple class taking a property and reference in the constructor;
>
> * The values are not injected into the fields.
>
> *//
>
> public class Impl2 {
>
> public String someProperty;
>
> public SomeService someReference;
>
> public Impl2(String a, SomeService b) {...}
>
> }
>
> *<mje> This one does not "unambiguously identify all property and
> reference values"</mje>*
>
> /** Class declaring a named property and reference through the
> constructor */
>
> public class Impl3 {
>
> @Constructor({"someProperty", "someReference"})
>
> public Impl3(String a, SomeService b) {...}
>
> }
>
> *<mje>@Constructor annotation has no such attributes (see [JAVACAA])
> </mje>*
>
> /** Class declaring a named property and reference through parameters */
>
> public class Impl3b {
>
> public Impl3b(
>
> @Property("someProperty") String a,
>
> @Reference("someReference) SomeService b
>
> ) {...}
>
> }
>
> *<mje>This one is OK</mje>*
>
> /** Additional property set through a method */
>
> public class Impl4 {
>
> public String someProperty;
>
> public SomeService someReference;
>
> public Impl2(String a, SomeService b) {...}
>
> @Property public void setAnotherProperty(int x) {...}
>
> }
>
> *<mje> This one does not "unambiguously identify all property and
> reference values"</mje>*
>
>
> Proposal:
>
> Replace the examples with the following ones:
>
> /** Constructor declared using @Constructor annotation */
>
> public class Impl1 {
>
> private String someProperty;
>
> @Constructor
>
> public Impl1( @Property("someProperty") String propval ) {...}
>
> }
>
> /** Declared constructor unambiguously identifying all Property and
> Reference values */
>
> public class Impl2 {
>
> private String someProperty;
>
> private SomeService someReference;
>
> public Impl2( @Property("someProperty") String a,
>
> @Reference("someReference") SomeService b )
>
> {...}
>
> }
>
> /** Declared constructor unambiguously identifying all Property and
> Reference values
>
> plus an additional Property injected via a setter method */
>
> public class Impl3 {
>
> private String someProperty;
>
> private String anotherProperty;
>
> private SomeService someReference;
>
> public Impl3( @Property("someProperty") String a,
>
> @Reference("someReference") SomeService b)
>
> {...}
>
> @Property
>
> public void setAnotherProperty( String anotherProperty ) {...}
>
> }
>
> /** No-arg constructor */
>
> public class Impl4 {
>
> @Property
>
> public String someProperty;
>
> @Reference
>
> public SomeService someReference;
>
> public Impl4() {...}
>
> }
>
>
> Yours, Mike.
>
> Strategist - Emerging Technologies, SCA & SDO.
> Co Chair OASIS SCA Assembly TC.
> IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.
> Phone & FAX: +44-1962-818014 Mobile: +44-7802-467431
> Email: mike_edwards@uk.ibm.com
>
>
> ------------------------------------------------------------------------
>
> /
> /
>
> /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/
>
>
>
>
>
>
---------------------------------------------------------------------
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]