I think entity-bean is a big part of EJB and will remain so. At the same time it is the most controversal part of the EJB. Hopefuly it will be improved further in the future.
Hibernate is an opensource project for object/relational persistence that solves many of the same problems as entity-beans do. It is much more lightweight and have support for things as transactions and caching.
http://www.hibernate.org Even if you use something like hibernate for persistence you can still session-beans to get the benefit of component-based architecture and location transparancy.
I believe that it always is a good reason to use the session facade, this is a attempt to show why.
It is two things when it comes to EJB that have a much bigger impact on performance than other things. The first thing is remote calls that can take up to 100 times longer than a local call. The other thing is roundtrips to the database. By designing the system so that these calls and roundtrips are as few as possible will improve the overall performance and limit the cost of hardware.
If you give a remote client a reference to say a movie-bean and that client need to get all fields from that movie, as name, description, year, director and so on, the client needs to make separate remote calls to get them. At the same time every method call to get a field will run in a separate transaction which will force the container to syncronize the bean with the database before and after each call. You could make the client start the transaction but it would make it to involved in the beans business and make them too tightly coupled.
With a session-bean acting as a facade the calls to get all fields could be made local between the session-bean and the entity-bean. The session-bean would then populate a value object and send that back to the remote client.
That would make only one remote call and the session-bean would start the transaction and the entity-bean method would take part in that transaction so it would mean only one database roundtrip as well.
/Best regards
[ December 13, 2003: Message edited by: Magnus Stattin ]