geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [xbean] annotation based dependency injection
Date Wed, 05 Apr 2006 06:37:43 GMT
On 4/4/06, David Blevins <david.blevins@visi.com> wrote:
>
> On Apr 3, 2006, at 5:12 AM, James Strachan wrote:
>
> > > so I'm sure the XBean/OpenEJB folks will be implementing this
> > anyway.
> >
> > I'm not yet at that point in understanding what Dave B. has already
> > done in OpenEJB 3, but you're right it will be of high priority to
> > implement.
> >
> > Agreed. Adding support for AnDI into XBean would be pretty easy
> > then OpenEJB could reuse that. I ultimately want the entire
> > Geronimo kernel to support AnDI; whether you use EJB3 or not.
>
> Trick is the @Resource annotation can't be used to annotate a
> constructor.
>
> Know anyone on JSR 250 who'd propose changing that?

Good point - though before JSR 250 & EJB 3, when Pico was just
starting, I tended to use the convention that contructor arguments
were 'mandatory' properties and setter methods were for optional stuff
(or stuff that can be configured after construction).

i.e.  its kinda implicit that any constructor arguments must be
injected to be able to construct the object - so they are mandatory
already. I guess a container could shove in null objects or zero
values if it can't find a value, but maybe its easier to just say that
for constructor injection, the parameters should be considered
mandatory?
--

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message