Javier Borrajo wrote:
> Is it legal to have an ejbbean making calls to static methods of other
> classes ?
Depends what you mean by legal. The call itself will work (it's just java
after all) and portability will not be affected.
> I know it is possible because it is working in our code. What I fear
> are the effect on the container managed transactions, security etc.
Well yes, depending on what your called class does. There seems to be two
reasons for doing what you suggest:
*a* When your application can't do what it needs to do within the EJB rules
then you might do this to isolate the code which violates EJB rules. Some
things would still be ill-advised, eg waiting on a semaphore, which could
seriously disrupt the EJB server. However other things would be fine, eg
creating a thread. Any work done under the thread will not be coordinated
by the underlying transaction however this may be exactly what you wanted.
Don't forget when doing this that you are now designing middleware and will
be subject to all the joy and pain this can bring, including the job of
rewriting it to work with each different EJB server!!
*b* When your java bean starts to look too big and cumbersome and you want
to use multiple java classes as a code structuring technique. No problems
here as long as you don't rely on instance or class variables between
calls.
> If this is possible we could write a single session bean that calls
> many different static business methods from 200+ classes. Otherwise
> we should make 200+ sesion beans which looks ugly to me.
It sounds to me though that you are creating a single session bean with
200+ methods and using multiple java classes to break up the code. Go for
it!
Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069
===========================================================================
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".