The 2nd technique has less overhead and uses less resources, and is
behaviorally the same as your 1st technique, so i would say do the latter!

Gene

-----Original Message-----
From: Alex Paransky
To: [EMAIL PROTECTED]
Sent: 6/22/01 12:21 PM
Subject: Qeustions regarding two session beans working together...

I have two stateless session beans in which bean A uses bean B.  Until
now,
we have been creating an instance of bean B in every method of bean A.
However, I am thinking that we should just create one instance of bean B
in
the ejbCreate and remove it in the ejbRemove methods.

So instead of:

class A {
  void foo() {
    create B;
    invoke B.method;
    remove B;
  }
}

VS:

class A {
  void ejbCreate() ... {
    create B;
  }

  void foo() ... {
    invoke B.method;
  }

  void ejbRemove() ...{
    remove B;
  }
}

Any comments?  What are the benefits of one VS the other method, if any?

Thanks.
-AP_

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

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