Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO with an Entity Bean using BMP

 
Eugene Sun
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In one of the INESystems mock exams, DAO with an Entity Bean using BMP is said to be

1) reduced dependency on data base
2) easier path to change the bean to CMP

I understand 1), but how is 2) true ?

Thanks,
Eugene
 
I Roberts
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is much easier to change a POJO than a EJB as an EJB is obviously a more complex object. Another advantage is that a DAO may be reused by one or more EJBs and not specifically a Entity JavaBean, while putting SQL in an Entity JavaBean could (in a bad design scenario) be potentially duplicating SQL in a DAO or another Entity JavaBean. As strange as it appears, this actually happens! Why? Well, old Entity JavaBean designs actually thought that it was more efficient to duplicate SQL direct in the EJB rather than consolidate SQL in a single POJO.

Hope this helps!?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic