Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on BMP

 
Puneet Srivastava
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is one question which i found on the net which talks about BMP. The question is..

160You are writing an Enterprise Javabean to represent a Flight in a Travel agency application. One of the developers recommended that you use Bean Managed Persistence (BMP) for the EJB. What is true about BMP?

AImproves your ability to move your EJB from one Application server to another.
BReduces your ability to move your EJB from one Application server to another.
CImproves your ability to move your EJB from one data store to another.
DReduces your ability to move your EJB from one data store to another.

Choice C is correct.


The answer here says that
*****************************
When you use Bean Managed Persistence you are writing all the SQL needed to persist the bean yourself. This means that the SQL would have been tailored to the data store you are using and the same SQL might not work with a different database vendor. You can cancel this out by using a Data Access Object. The Data Access Object pattern (DAO) is used to reduce the dependency between Enterprise Beans and the underlying database. This means that the data object manages the connection to the data source and if the data source changes you only need update this one object, the change doesn't affect the rest of your application.
*******************************

My doubt is that the question does not mention anything about using DAO. So correct answer should be D. Unless other wise question mentions DAO usage, BMP will pose problems in moving to another data source because of tight coupling with SQLs.

Pls correct me if i am wrong....

thanks
Puneet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic