Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Head First - EJB

 
Kalyani Nayak
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In 'Head First EJB' book,
In the chapter 'Client View - Exposing Yourself'
on page no. 137, Under point 2)get the bean's home
I found one line a little confusing
'Even if you are capable of doing a jndi lookup on home, calling getEJBHome() on the bean is more efficient'.

Can anybody please explore this in detail.
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we need a little more context. But, since I have the book, I looked it up and found that my assumption is correct.

On that page, in that paragraph, you already have the Bean, so it is much easier to just call getEJBHome on the Bean than doing a whole JNDI lookup. JNDI Lookup would take more time to complete than a call to getEJBHome.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!