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

Head First EJB,Chapter-3,COFFEE CRAM-MOCK EXAM

 
Chithra Salam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First EJB,Chapter-3,Page-170,COFFEE CRAM-MOCK EXAM-q3

Q:Given a Remote Client 'R' that has valid references to sesion bean 'A' and 'B'and given that A is a local clint to B,which statements are true?

A)R cannot pass his reference for A to B
B)A cannot pass his reference for B ,to R
C)A cannot invoke methods on B
D)B cannot invoke methods on R

Query:

Can anyone of explain to me in detail about "What this Question means" and How they are coming to the Ans-B,D.and Why others are wrong.

Please help me to solve this.

ChithraSalam
SCJP 1.4(85%)
 
Neeraj Chaturvedi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here they are testing you on very simple concept of "has a" relation

"R" has a "A" and "B"
"A" has a "B"

so although
"R" can access the method of "A" and "B"
and "A" can access the method available with "B"

but "B" can't invoke the methods on "A" or "R"

now as "A" has a local reference of "B" so it can't pass it to a Remote Client "R"

I think for option A) they misprinted it, because "B" never needs "A" although "R" can pass his reference for "B" to "A"
 
Gopi Donthireddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2 things here:

1) U cannot pass a local reference to a remote things.
2) The bean can't invoke methods on a client. It's the other way around!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic