Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Entity Beans /DAO's

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic