Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB Errata?

 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFEJB Page 325 mentions that if a client wants a refernce to the EJB Object he can also call a home business method that returns the bean's component interface

The book at a later stage mentions that Home Business methods should not be used to return reference but data or value objects..

I did not find this in Errata - confirmed/unconfirmed.

Can someone referring the book agree/disagree?
 
Sue Pillai
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what you are arriving at, but I hope my explanation will help.

The home interface has 3 kinds of methods:

1) create methods that return references to component interface

2) finders or getters that return reference to the component interface or a collection of them. The reason for having these is to find an existing bean

3) the business methods that return Value objects. The reason for having a business method is to use these value objects and get the entity data or a collection of them, so as to reduce network calls. That is, the bean can stay in pool to do the deed and does not need an EJBObject

What I understood is that 2) & 3) that are collectively called business methods, may return EJBObject references or value objects. Check pg 278.

The book at a later stage mentions that Home Business methods should not be used to return reference but data or value objects..


which page are you referring to here?
[ April 06, 2006: Message edited by: Sue Pillai ]
 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sue,

Let me elaborate..if you look at Page 325 Circled Point 3..it mentions that home Business methods can return a reference to bean's component interface...

Now if you look at 346..sub topic..What to put in a home business method...it says and i Quote "...and that don't return the beans component interface..."

If i have to return a EJB Object reference..i'd rather use a finder...the entire purpose of a homeBusiness Method is to return data ..

Correct me if i am wrong..but i sense a contradiction
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic