aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes mock question : Please clarify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "mock question : Please clarify" Watch "mock question : Please clarify" New topic
Author

mock question : Please clarify

Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
Please see the following question :
Which of the following are required for a concrete entity bean class (from the Bean Provider)? [Check all correct answers]
1 Must have the finalize() method.
2 The class must define a public constructor that takes no arguments.
3 The class must be defined as public and must be abstract.
4 The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.

The answers given are 2, 3, 4.
I think 3 is not correct because the question is for "concrete" bean class.
BMP entity beans have concrete implementation for bean classes and they are not abstract.
Please clarify.
Thanks,
Prasad
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
When you define abstract getters & setters for virtual field of CMP Entity bean your class will be abstract & public (must). Also remember you can have concrete methods in abstract class.
Above apply to bean provider point of view.


SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
Thanks for reply.
I understand that. What I don't understand is: In the question, why the bean class is called concrete class? ( rather than abstract class )
Prasad
[ February 18, 2004: Message edited by: Prasad Kuppa ]
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
if you are using CMT in that case entity bean will be abstract (as we know NO BMT for entity bean)
[ February 18, 2004: Message edited by: Nehul Nalekar ]
Todor Mollov
Ranch Hand

Joined: Jan 13, 2004
Posts: 30
Sorry to interrupt but Nehul is right:
as we know NO BMT for entity bean
but is wrong for :
if you are using CMT in that case entity bean will be abstract

Entity beans have Bean Managed Persistance BMP or Container Manged Persistance CMP. But they only have Container Managed Transactions CMT.
So if Entity bean is BMP it is concrete and if is CMP it is abstract.
I'm agree with Prasad that something smells about the question.
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
when you are using container manage your class will be abstract & that relate to persistence. Because container will implement all database access code for you. So your getters & setters will be public & abstract. Just wanted to point out that you can use CMT only with entity bean not BMT. But CMT OR BMT won't decide the answer of above question.
You will find such tricky question in mock exam but not in real exam, where everything will be stated in right sense.

Even I was caught in such situation.. read Kathy's reply..
http://www.coderanch.com/t/158645/java-EJB-SCBCD/certification/HF-EJB-PAGE
Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
Thanks Todor & Nehul .
Nehul, your answer is more confusing than the question! When the question is about entity bean persistences, you are also bringing up the transactions into answer!
anyways, I got it.
Prasad
 
jQuery in Action, 2nd edition
 
subject: mock question : Please clarify