In EJB1.1, multi-object finders can return java.util.Collection (spec
9.1.8.2).  It's clear that such a finder can be written as:

    public java.util.Collection findSomeBeans(..) { ... }

what's not clear to me is whether a bean can be written to return a specific
Collection implementation, such as ArrayList.  Is it acceptable to write a
finder like the following?

    public java.util.ArrayList findSomeBeans(..) { ... }

>From the client perspective, it doesn't matter.  The client can assign the
returned object to a Collection reference in either case.   The only
implication I see is with the container implementation deciding how to
manage the return type from an arbitrary finder.  If only the first style is
permitted, the container can key on the return class type (look specifically
for java.util.Collection).  If the second type is permitted, the container
must inspect the return type to see if it implements the Collection
interface.

The same issues go for finders that return Enumeration, though I wouldn't
expect to find any finders which returned specific public classes which
implement Enumeration.  Unlike the Java 2 Collections (in which all the
concrete implementations implement Collection), those classes which return
Enumeration generally delegate to inner classes.

===========================================================================
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