sca-assembly message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [sca-assembly] [ISSUE 201] : Test 6019 assumed injection behavior
- From: Mike Edwards <mike_edwards@uk.ibm.com>
- To: OASIS Assembly <sca-assembly@lists.oasis-open.org>
- Date: Wed, 13 Jan 2010 09:03:28 +0000
Jim,
Not injecting 0..n references (or rather
injecting null) would then be different from 1..n references, where
at least one wire is required. The
difficulties you describe below would all necessarily exist for 1..n
references, so I am not sure that it
makes much difference for 0..n references.
But as Dave says, all this matches the
SCA Java specs so I believe that it is correct.
You are of course welcome to raise new
issues against the Java specs, but I think until the Java
specs are modified that the design of
this testcase in the Assembly suite is acceptable.
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
From:
| Jim Marino <jim.marino@gmail.com>
|
To:
| OASIS Assembly <sca-assembly@lists.oasis-open.org>
|
Date:
| 13/01/2010 00:24
|
Subject:
| Re: [sca-assembly] NEW ISSUE: Test 6019
assumed injection behavior |
Oh, that is really unfortunate. Besides the inconsistency
and behavior
which is different from most other dependency-injection models, it
makes out-of-container testing more complex and error prone. For
example, this is going to force test fixtures to manually inject empty
multiplicity types (collections, arrays, etc) while not doing so for
0..1 references. It would have just been easier to allow containers to
avoid injecting unsatisfied references which would allow test fixtures
to avoid unnecessary code. In addition, it would make containers
slightly faster as not injecting would save a reflection call or
method dispatch.
Jim
On Jan 12, 2010, at 6:07 PM, David Booz wrote:
> I recall it was something we discussed (including the consistency
> aspect of
> the issue), but the specific issue number escapes me at the moment.
> In any
> case, what I've quoted is what the spec says right now.
>
> Dave Booz
> STSM, BPM and SCA Architecture
> Co-Chair OASIS SCA-Policy TC and SCA-J TC
> "Distributed objects first, then world hunger"
> Poughkeepsie, NY (845)-435-6093 or 8-295-6093
> e-mail:booz@us.ibm.com
>
>
> |------------>
> | From: |
> |------------>
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |Jim Marino
> <
> jim
> .marino
> @gmail
> .com
> >
>
|
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | To: |
> |------------>
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |OASIS Assembly <sca-assembly@lists.oasis-
> open
> .org
> >
>
|
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Date: |
> |------------>
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |01/12/2010 10:47
> AM
>
|
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Subject: |
> |------------>
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
> |Re: [sca-assembly] NEW ISSUE: Test 6019 assumed injection
> behavior
>
|
>> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
> I thought the behavior was runtimes could avoid injecting null
> references for all multiplicity values. Maybe this was changed or
I
> was just wrong. This seems a little strange though as the behavior
for
> 0..1 will be different than 1..n, i.e. the former is not injected,
the
> latter is.
>
> Jim
>
>
> On Jan 12, 2010, at 2:29 PM, David Booz wrote:
>
>> An unwired reference with a multiplicity of 0..n MUST be presented
>> to the
>> implementation code by the SCA runtime as an empty array or empty
>> collection [JCA90023]
>>
>>
>> How can a runtime have a null reference given the above
statement in
>> Java CAA?
>>
>>
>> Dave Booz
>> STSM, BPM and SCA Architecture
>> Co-Chair OASIS SCA-Policy TC and SCA-J TC
>> "Distributed objects first, then world hunger"
>> Poughkeepsie, NY (845)-435-6093 or 8-295-6093
>> e-mail:booz@us.ibm.com
>>
>>
>> |------------>
>> | From: |
>> |------------>
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |Mike Edwards
>> <
>> mike_edwards
>> @uk
>> .ibm
>> .com
>>>
>>
> |
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |------------>
>> | To: |
>> |------------>
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |OASIS Assembly <sca-assembly@lists.oasis-
>> open
>> .org
>>>
>>
> |
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |------------>
>> | Date: |
>> |------------>
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |01/12/2010 04:16
>> AM
>>
> |
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |------------>
>> | Subject: |
>> |------------>
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>> |Re: [sca-assembly] NEW ISSUE: Test 6019 assumed injection
>> behavior
>>
> |
>>>
> --------------------------------------------------------------------------------------------------------------------------------------------------|
>
>>
>>
>>
>>
>>
>>
>> Logged as: http://www.osoa.org/jira/browse/ASSEMBLY-201
>>
>> 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
>>
>>
>> From: Jim Marino <jim.marino@gmail.com>
>>
>> To: OASIS Assembly <sca-assembly@lists.oasis-open.org>
>>
>> Date: 11/01/2010 18:16
>>
>> Subject: [sca-assembly] NEW ISSUE: Test 6019 assumed injection
>> behavior
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> TARGET: SCA Assembly Conformance Tests
>>
>> DESCRIPTION:
>>
>> Test case ASM_6019 verifies an autowire reference with multiplicity
>> 0..n that has no matching services still runs. The component
>> implementation, org.oasisopen.sca.test.service1Impl4, has an array
>> type for the autowire reference. The operation that is invoked
on
>> that
>> implementation iterates the array and invokes wired services without
>> checking for null. Some runtimes may not inject the reference
if no
>> matching wires are found. Consequently, this results in an NPE
since
>> the reference member variable is not set:
>>
>> @Service(Service1.class)
>> public class service1Impl4 implements Service1 {
>>
>> @Property
>> public String
serviceName = "service1";
>> // Required =
false + an array -> multiplicity 0..n
>> @Reference(required=false)
>> public Service1[]
reference1 = null;
>>
>> public String
operation1(String input) {
>>
String result = serviceName
+ "
>> operation1
>> invoked";
>>
// Call each of the references
in the
>> array, concatenating the results
>>
for( int i=0 ; i <
>> reference1.length; i+
>> + ) {
>>
result =
>> result.concat("
>> ");
>>
result =
>> result.concat
>> ( reference1[i].operation1(input) );
>>
} // end for
>>
return result;
>> }
>>
>> }
>>
>>
>> SVN Version: 426
>>
>> PROPOSAL:
>>
>> Code defensively, assuming the reference may not be injected.
A
>> potential replacement is:
>>
>> @Service(Service1.class)
>> public class service1Impl4 implements Service1 {
>>
>> @Property
>> public String
serviceName = "service1";
>>
>> @Reference(required=false)
>> public Service1[]
reference1;
>>
>> public String
operation1(String input) {
>>
StringBuilder result =
new
>> StringBuilder
>> (serviceName).append("
>> operation1 invoked");
>>
for (Service1 aReference1 : reference1) {
>>
String value =
>> aReference1.operation1(input);
>>
result = result.append("
>> ").append(value);
>>
}
>>
return result.toString();
>> }
>>
>> }
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 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
>>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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
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]