interface to acces ejb

Hi,

Can somebody please help me with the following question.

Why is it that when we want to use a ejb from within another ejb, we use interfaces to acces/find this other bean, and not just an object?

I have some thoughts on it, like:

* does it support lazy creation?

* does it deliver the possibility to use different implementations of the interfaces methods at run deployment time?

* to make a distinction between local and remote beans/interfaces?

Thanks!

Vaak

[518 byte] By [vAaka] at [2007-11-27 7:48:21]
# 1

Hi Vaak,

Many of the reasons you thought of are correct.Preventing the client from holding a direct

reference to bean class instance is a key part of providing the value-added services of the

EJB container.It allows for lazy loading , transparent passivation/activation of stateful

session beans, concurrency control, etc. It's also important from a design perspective as it

decouples the client code from the bean implementation.Coding to interfaces prevents

client code from depending on things in the bean class that are not relevant to the client

view.

--ken

ksaksa at 2007-7-12 19:29:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...