Hi, comments in line...
> I recently heard from a friend of mine that sun is considering scrapping
> the Entity beans concept and is trying to push Message driven beans and
> Data Access Objects+Session Beans as alternatives. The reason they have
put
> forward is performance bottlenecks for large applications. Any comments?
>
That would be very interesting. When the EJB 1.0 spec was coming out I
worked
for Oracle, and supposedly the Oracle fought against Entity Beans, though I
don't know whether it was a good reason or if it was just business.
> I have a few questions regarding Data Access Objects
>
> 1. My idea of DAOs are that they abstract away the database specific stuff
> from Java code and provide a clean separation between Java and Sql. Is
> there anything more to it?
DAOs abstract the database specific persistence stuff from the business
logic,
but they are implemented (in a J2EE world) in Java. Some people advocate
the
use of DAOs with Entity Beans in an effort to keep the two separate. Of
course
this also helps if you push any database access into the session beans since
both entity beans and session beans can use the same DAO classes to access
the
database.
> 2. Is there any pooling mechansim for such objects? If we are going for
> Session beans+DAO instead of Session Bean+Entity Beans ,won't the
absence
> of object pooling for DAOs affect the application performance?
There are quite a few objects created during the average load of a database
object into a JVM via JDBC, for example think about Strings and Dates, not
to
mention what is going on underneath the covers. Everything I have read
indicates that the need for object pooling (caching empty objects) is much
less than people think when it comes to these types of expensive operations.
> 3. Are there any special considerations that need to be taken it account
> for application server clustering in case we go in for DAOs?
I haven't done much application server clustering, but I would think
a few questions would be. Is the DAO cache shared or not? Is traffic
sticky? What does the appserver do with Entity beans, are they sticky?
Or can it activate the same entity bean on several machines at the same
time if there are multiple clients?
> 4. I would like to have some more info into the prons and cons of this
> approach versus using Entity beans. Any white papers?
I think with entity beans it is very easy to pull too much data out of the
database, process it in Java, and then put it back in. Several years ago,
I built stateless servers that only cached some of the data. They used
stored procedures to do most of the work in the database. This approach
has historically been very successful. It does have drawbacks too though,
in portability and in scalability of the database.
I think it really depends on the type of application you are building
and on the tools you will use. You shouldn't be writing a lot of this
code yourself whichever way you use, entity beans or DAO.
Cheers
Jay Walters
===========================================================================
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".