Danny Angus wrote:
On 11/8/06, Serge Knystautas <[EMAIL PROTECTED]> wrote:

I prefer dependency injection to service lookups, so much of what you
guys are discussing seems moot to me.  Since you (one or both of you)
have expressed preference for dependency injection as well, I'm
struggling to picture the use cases for when JNDI lookup is necessary.
 Can you guys give some examples to help me understand this
requirement?

You invent a new service (which depend upon other services) and a
mailet which uses it, your service is instantiated then your mailet &
matcher require a reference to it. Do you:

a) have it injected by declaring all of your dependancies in configuration

imho you declare the dependencies (dependency on service interfaces) in the mailet (either via annotation or via descriptor) and then you use configuration to let it know the real implementation you want to provide for that dependency. This is vendor/container specific: some container could use autowiring, someone else xml based wiring and so on.

Stefano

b) look it up yourself from a configured name
c) none of the above - discuss


d.



Reply via email to