Very good question. We're struggling with the same issue.
Everything I can find in the "J2EE Developer's Guide" and the
"Developing Enterprise Applications with J2EE" book says
that you should use entity beans for objects that represent
persistent business entities, but I can't find much on why.
Take a look at both of these docs though. They at least
shed a little light on the subject. They're both available
at java.sun.com
The best reasons I've found for using entity beans is
reuse of those fine-grained components. Using entity beans
allows you to take advantage of the services provided by
the container including persistence, transactions,
concurrency, etc. This means less code in your entity
beans and more reuse in different environments (i.e. databases).
With session beans, you can't do that.
Now if I'm doing BMP rather than CMP, I see less of an
argument for entity beans because I'm not taking advantage
of the containers's services as much. The line gets
fuzzy there again.
Any other thoughts?
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hello everybody.
>
> First of all, sorry for my question.
>
> Till now, I was using an Application Server which didn't support Entity Beans, and
>as my new Appiclation Server supports them, I must ask you that question.
>
> Since I think that almost all the server work can be done using Stateless Session
>Beans (inserts, updates and so on into the database), is there a good reason to use
>Entity Beans for representing table rows?
>
> Isn't there lots of overhead (creation, remote invokes and so on) if you only want
>to make an insert? or only an update?
>
> Since the DB surely has it's own cache mechanisms, Entity Beans cannot be used in
>order to cache data in the server memory.
>
> One last question: if my DB has load balancing mechanisms, I think that that
>performance improvement will be lost using Entity Beans.
>
> Maybe this question has already been answered in this forum, but I'm really very
>interested in your oppinion.
>
> Please sorry if you think I'm a fool but I can't understand the reasons for having
>Entity Beans.
>
> Abstraction of SQL calls? Ok, use helper classes.
>
>
> Thank you very much and sorry for my lack of faith.
>
> Jesus
===========================================================================
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".