EJB allows a bean class to implement remote interface
but this practice is discourage for some good reasons.
 First, the remote interface actually extends the
EJBObject interface.  This interface defines several
method that is defined by the EJB container and not
the bean class.  If the bean class implements the
remote interface, it should override several useless
methods that are not used such as the getEBJHome,
getHandle etc... Another reason is that if you're
passing a remote object, you don't want the client
(bean class can be client to other bean) to be able to
use the 'this' keyword, not implementing the remote
interface would prevent developer from doing so...



--- Stu Halloway <[EMAIL PROTECTED]> wrote:
> "Andy L. Czerwonka" wrote:
>
> > Question.  The bean class implements the bean's
> functionality.  The remote
> > interface defines the interface.  Why doesn't the
> bean class implement the
> > remote interface?  I must have methods presented
> in the remote interface,
> so
> > why doesn't it just implement it?
> >
>
> Mark replied:
>
> > The main reason for this is to prevent the EJB
> class from mistakenly
> > being called directly rather than through its
> remote interface. If this
> > were done, the container is taken out of the loop
> - this breaks the
> > component model.
>
> > EJB allows the class to inherit its remote
> interface for those who
> > prefer this style; it does not require it for the
> reason above.
>
> Andy,
>
> Also beware that while the EJB spec permits a bean
> class to implement its
> remote interface, not all EJB implementations
> support it (WebLogic doesn't).
>
> Stu Halloway
> DevelopMentor
>
>
===========================================================================
> 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".
>
>


=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

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