users@glassfish.java.net

Re: appclient issue/misunderstanding

From: <glassfish_at_javadesktop.org>
Date: Tue, 06 Mar 2007 07:57:21 PST

> I can go back to a ResourceHelper approach. This was
> generally the approach used when JNDI lookup was
> necessary So, essentially the client code looks the
> same as it did for EE 1.4, except that the guts of
> ResourceHelper are different. That's what I mean by
> annotation at the client side being useless with this
> restriction.

It's true that extending Java EE 5 annotation support to a larger set of classes would
be a good thing. We're looking into that for Java EE.next. However, even in Java EE 5
keep in mind that an environment annotation does two things : declares the dependency
and optionally injects it into a field/method. Even without the injection, the ability to
declare a resource-ref/ejb-ref/webservice-ref,etc. in the code instead of via XML is
a big ease-of-use improvement. In most cases it means there's no need to even
supply an application-client.xml.

Another thing to consider is that *any* environment annotation, whether it appears
at the field, method, or class-level, can always *also* be looked up via the
component environment. The name() attribute is what determines the location relative
to java:comp/env. In the absence of a name() attribute, the default for a field-based
annotation is <declaring-class-fully-qualified-class-name>/<field name>.

 --ken
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=206472