Do you think it would be overkill to also provide a method which performs
specified injection? Something like this...
public void injectDependencies( Registry registry, Object dependentObject );
public void injectDependencies( Registry registry, Object dependentObject,
DependencyDescriptor[] dependencies );
A DependencyDescriptor would look like...
public class DependencyDescriptor
{
public Class getDependencyType();
public String getPropertyName();
public String getDependencyId();
}
Basically, this is for when you have multiple service points with the same
service interface. I added the Registry parameter because I don't know
whether or not this should be a service. Maybe it could just be a helper
method somewhere (or added to Registry itself). Wouldn't we run into a
chicken and egg situation if we wanted to make this a service? I mean, what
builds the service implementation for this service? BuilderFactory? But,
what does BuilderFactory use to wire together the implementation object?
Even if we make it a primitive service (which I don't think is built by
BuilderFactory), what injects its dependencies? I may be wrong here, as I
haven't really thought through it completely (need more coffee), but
something just doesn't smell right to me (maybe I need a shower too).
-----Original Message-----
From: Knut Wannheden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 27, 2004 8:23 AM
To: [email protected]; Howard Lewis Ship
Subject: Re: Simple Bean injection
Then IIUYC the service you're talking about (let's call it
BeanFactory) would be a factory service implementing
ServiceImplementationFactory. Thus, by the user only used inside
module descriptors. This would certainly be useful.
The service I was trying to describe (let's call it ServiceInjector)
would be yet another service responsible for the actual dependency
injection. It could be injected into BuilderFactory and BeanFactory,
which would use it to implement the autowiring.
In addition to that users could have ServiceInjector injected into
their own service implementations, where they'd be able to use it to
autowire any objects being constructed. Would that make sense?
--knut
On Wed, 27 Oct 2004 07:57:48 -0400, Howard Lewis Ship <[EMAIL PROTECTED]>
wrote:
> I think we could have a service and configuration. The configuration
> contributions look much like the <construct> parameter to
> BuilderFactory. The service simply allows access to beans specified
> inside.
>
> Because there aren't proxies for beans, we'll have to be extra careful
> to detect dependency cycles between beans.
>
> In addition, we could define a ObjectProvider for prefix bean:
> (perhaps that will be the only way to access such beans?)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]