I apologize if this has already been answered, but I was
wondering if there was a definitive ruling on how array
parameter types should be defined in <method-param>
declarations.
For example, consider the following finder method:
public interface InstructorHome extends javax.ejb.EJBHome {
java.util.Collection findByStates(String[] states)
throws java.rmi.RemoteException, javax.ejb.FinderException;
<etc>
}
Let's say I want to define the <container-transaction> for this
method. I could use:
<container-transaction>
<method>
<ejb-name>instructors</ejb-name>
<method-name>findByStates</method-name>
<method-params>
<method-param>java.lang.String[]</method-param>
</method-params>
</method>
<trans-attribute>Mandatory</trans-attribute>
</container-transaction>
or I could use:
<container-transaction>
<method>
<ejb-name>instructors</ejb-name>
<method-name>findByStates</method-name>
<method-params>
<method-param>[Ljava.lang.String;</method-param>
</method-params>
</method>
<trans-attribute>Mandatory</trans-attribute>
</container-transaction>
Note the difference in the <method-param>. In one case I
am using the "source code" version:
java.lang.String[]
and in the other case I am using the "internal" type name:
[Ljava.lang.String;
Obviously, the first version is much preferred, from a
readability stand-point. But my concern is that the
Reference Implementation uses the second version, and this
made me wonder if somewhere the EJB specification suggested
that using (hard to read) internal singatures was preferred
to using (easy to read) source code style.
In case this decision has yet to be made, let me provide a
test. Which is simpler to understand:
<method-name>findByComplex</method-name>
<method-params>
<method-param>java.lang.String[]</method-param>
<method-param>boolean[]</method-param>
<method-param>long[][][]</method-param>
</method-params>
or:
<method-name>findByComplex</method-name>
<method-params>
<method-param>[Ljava.lang.String;</method-param>
<method-param>[Z</method-param>
<method-param>[[[J</method-param>
</method-params>
To specify the method:
findByComplex(String[], boolean[], long[][][])
Hopefully I am not the only one who prefers the source code
version.
-jkw
===========================================================================
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".