Hi!

Heiko Gottschling wrote:
> > Then, the Assembler takes a bunch of beans and package them into a
> > logical application. Part of his work is to resolve ejb-ref's. This is
> > done by looking at the <home> and <remote> tags and finding the
> > appropriate beans to resolve them into. The Assembler hence adds the
> > <ejb-link> element to the bean the ejb-ref should point to. When the
> > Assembler is done there are no ejb-ref elements without a ejb-link
> > child. So, now it is not optional although the DTD says it is. It is
> > still syntactically optional, but semantically it is required after this
> > step.
>
> I still don't quite get it. Two questions:
>
> 1) If the app assembler can find the appropriate beans by looking at the
> <home> and <remote> tags, why can't the J2EE container itself do so (i.e.
> find the referenced beans by their class names, rather than by <ejb-link>)?

There may be two or more beans with the same home/remote combo.

But sure, if there's only one bean then the container could try to guess
the bean. But the specification needs to be able to handle *all* cases.

> 2) I've written a small test application consisting of only two beans, one
> referencing the other. However, I omitted the <ejb-link> tag. Nevertheless,
> the application works fine and the referencing bean finds the other one
> without problems. Why does this work if <ejb-link> is semantically required,
> as you say?

Because the container may be clever enough to figure out which bean
you're referring to.

See above. Just because your particular case doesn't require ejb-link
doesn't mean that there are others that do.

/Rickard

--
Rickard �berg

Email: [EMAIL PROTECTED]

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


Reply via email to