Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Entity Beans /DAO's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Entity Beans /DAO Watch "Entity Beans /DAO New topic
Author

Entity Beans /DAO's

Balaji Rajagopalan
Greenhorn

Joined: Aug 21, 2006
Posts: 9
hi

I have some doubt regarding the usage of Entity Bean and DAO in part2 assignment. As DAO can also be used for Rean and Write Operations from DB , is that neccessary to use Entity Bean .
Cleuton Sampaio
Ranch Hand

Joined: Nov 11, 2005
Posts: 181
Hi, please note that I haven�t received my results yet.

But I have used only DAOs in my assignment. I have seen some people using Entities and passed the exam too. But, if you look at Mark Cade�s book, you will see that he used only DAOs.

According with CORE J2EE PATTERNS book, plain entities should not be used. Instead, you should use Composite Entities. The problems with Entities are: heavy load on the application server and database lock.


Cleuton Sampaio<br />Systems Architect<br />(SCEA,SCWCD,SCBCD,MCSE,MCSD)
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi Cleuton,

You said:

But I have used only DAOs in my assignment. I have seen some people using Entities and passed the exam too. But, if you look at Mark Cade�s book, you will see that he used only DAOs.


If we look at the Browse Catalog sequence diagram on page #174, we see the ShoppingCart and Product. Are they DAOs? And what about his Class diagram?

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Hi Balaji,

As Cleuton said, the Core J2EE Patterns book speaks about this issue. It says that using DAOs only, can be sufficient in many cases and in some other cases, entity beans can help in scaling up the application.

So, it's up to us to decide how to architect the solution for our assignment.

Regards,
Dan
Petr Kleja
Greenhorn

Joined: Nov 01, 2005
Posts: 29
Hi collegues. Allow me to express my opinion. According J2EE Core Patterns DAO can be used instead of "read only" entity beans because main drawback of using entity beans is method ejbStore() that is called also in cases when there is no need for an update.
Using DAO we can separate read-write functionality. I think that nowadays it is very questionable whether to use DAO or Entities with CMP. So far I am thinking about modern second way (entities with CMP), because nowadays J2EE Containers are very efficient.

I am not still decided whether I should prepare my architecture for "old" environment or to take in account EJB 2.0.

Petr (SCJP, SCBCD, SCWCD, SCMAD, SCDJWS, SCEA-I)
Czech republic, Prague
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entity Beans /DAO's