You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jim Marino <jm...@myromatours.com> on 2006/07/15 07:23:46 UTC
Spec proposal for explict declaration of constructor-based properties and references
Currently, the spec will allow constructor-based injection such as
the following:
public class FooImpl implements Foo{
public FooImpl(Bar bar) {
// do something
}
}
@Remotable
public interface Bar{
}
In the above, the runtime will determine that the constructor
parameter is a reference by reflecting the Bar interface marked with
@Reference and will inject it. I'd like to propose to the spec group
that we also allow explicit demarcation of constructor properties and
references:
public class FooImpl implements Foo{
public FooImpl(@Reference Bar bar, @Property baz) {
// do something
}
}
public interface Bar{
}
What do people think?
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Spec proposal for explict declaration of constructor-based properties and references
Posted by Jeremy Boynes <jb...@apache.org>.
On Jul 15, 2006, at 7:24 AM, Jim Marino wrote:
> You know, I completely missed that. Originally I remembered it
> being in there, or assumed it would be, and when I went back
> yesterday to implement it I didn't see it and I thought it strange
> that it would be left out. I'll need to go back to the spec to make
> sure it is in there. Also, I think we should make it a little more
> evident in the spec since I missed it yesterday.
>
I did notice the PARAMETER change had not been made to the API
classes yet.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Spec proposal for explict declaration of constructor-based properties and references
Posted by Jim Marino <jm...@myromatours.com>.
You know, I completely missed that. Originally I remembered it being
in there, or assumed it would be, and when I went back yesterday to
implement it I didn't see it and I thought it strange that it would
be left out. I'll need to go back to the spec to make sure it is in
there. Also, I think we should make it a little more evident in the
spec since I missed it yesterday.
Jim
On Jul 15, 2006, at 6:58 AM, Jeremy Boynes wrote:
> I may be missing the point but wasn't this in that chump's proposal
> already:
>
> "The property or reference associated with each parameter of a
> constructor is identified by name in the @Constructor annotation
> (if present), *though the presence of a @Property or @Reference
> annotation on the parameter declaration*, or by uniquely matching
> the parameter type to the type of a property or reference defined
> by annotation of a field or setter method or declared in a sidefile."
>
> Also @Property and @Reference were extended to support PARAMETER
> targets.
>
> --
> Jeremy
>
> On Jul 14, 2006, at 10:23 PM, Jim Marino wrote:
>
>> Currently, the spec will allow constructor-based injection such as
>> the following:
>>
>>
>> public class FooImpl implements Foo{
>>
>> public FooImpl(Bar bar) {
>> // do something
>> }
>> }
>>
>> @Remotable
>> public interface Bar{
>>
>> }
>>
>> In the above, the runtime will determine that the constructor
>> parameter is a reference by reflecting the Bar interface marked
>> with @Reference and will inject it. I'd like to propose to the
>> spec group that we also allow explicit demarcation of constructor
>> properties and references:
>>
>>
>> public class FooImpl implements Foo{
>>
>> public FooImpl(@Reference Bar bar, @Property baz) {
>> // do something
>> }
>> }
>>
>> public interface Bar{
>>
>> }
>>
>> What do people think?
>>
>> Jim
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Spec proposal for explict declaration of constructor-based properties and references
Posted by Jeremy Boynes <jb...@apache.org>.
I may be missing the point but wasn't this in that chump's proposal
already:
"The property or reference associated with each parameter of a
constructor is identified by name in the @Constructor annotation (if
present), *though the presence of a @Property or @Reference
annotation on the parameter declaration*, or by uniquely matching the
parameter type to the type of a property or reference defined by
annotation of a field or setter method or declared in a sidefile."
Also @Property and @Reference were extended to support PARAMETER
targets.
--
Jeremy
On Jul 14, 2006, at 10:23 PM, Jim Marino wrote:
> Currently, the spec will allow constructor-based injection such as
> the following:
>
>
> public class FooImpl implements Foo{
>
> public FooImpl(Bar bar) {
> // do something
> }
> }
>
> @Remotable
> public interface Bar{
>
> }
>
> In the above, the runtime will determine that the constructor
> parameter is a reference by reflecting the Bar interface marked
> with @Reference and will inject it. I'd like to propose to the spec
> group that we also allow explicit demarcation of constructor
> properties and references:
>
>
> public class FooImpl implements Foo{
>
> public FooImpl(@Reference Bar bar, @Property baz) {
> // do something
> }
> }
>
> public interface Bar{
>
> }
>
> What do people think?
>
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org