Hi,

  Another question about Dukes Pet Store:

  The EJB 1.1 Specification stresses the fact that a reference to a bean
should not be passed to another class.  Rather, the EJB Object reference
should always be passed to another class as a parameter if communication
with the bean is required by that other class.

  The com.sun.estore.control.ejb.StateMachine class is constructed by the
com.sun.estore.control.ejb.ShoppingClientControllerEJB using the following
code:

    public void ejbCreate() {
        sm = new StateMachine(this);
    }

    The StateMachine then logs out the user using this code:

    private void logout () {
        sccejb.ejbRemove();
        Debug.println("Logged out user.");
    }

   This seems to be a complete contradiction of the way things are supposed
to be done.  In this case the container has no idea that the bean has been
removed.  I assume the RI gets away with this code since it probably clears
out the beans from the session during a logout but the assumption can not be
made for all servers.

  Again, have I misunderstood something?

  Thanks.

-- Jon

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