Hey

"Bailey, Jeff" wrote:
> "Rickard �berg" wrote:
> >... i.e. it's ok to use Class.getResourceAsStream() and ResourceBundles.
> >I prefer the latter.
>
> That's very useful information I never knew - thanks!  Can you explain why
> it's okay to user Class.getResourceAsStream, but not java.io directly?  I'd
> like to understand the rationale behind the restriction.

Well, I don't know about the actual rationale other than that files are
considered bad practice when dealing with Enterprise applications.
Databases with transactions and such are in general a much better idea.

On a more technical level Class.getResourceAsStream may use java.io
since it's in the JDK package, hence it has the right Permissions to do
I/O. This holds true for any classes: if they're not in the actual EJB
package, and has file I/O permissions set, then a bean may access files
through them. Not recommended, re: above, but technically possible.

> Also, concerning JNDI properties.  I just read in Ed Roman's new EJB book
> that an EJB does not need to pass properties for the default JNDI initial
> context in 1.1.  The container will set this up for you.

Indeed. EJB1.1 is only .1 from EJB1.0, but it is IMHO much much much
better :-)

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

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