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

Reflection API

 
Imran Vohra
Ranch Hand
Posts: 77
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found one question on reflection API in HFEJB final mock exam.
Question is
When programming an entity bean class which technique(s) should be AVOIDED to ensure bean portability across all EJB 2.0 containers? (choose all that apply)
A. changing a thread's priority
B. Using the reflection API
C. Using wrapper classes
D. Using static nested classes
Ans is (A) & (B).
A is OK.
I am confused with option B.
yes, that's right that some of methods of reflection API we have to avoid.
But at the same time book is saying that getEJBMetaData() method in lcoal home interface (EJBLocalHome) is not required as we can use reflection API(Page 149). So, what's right we have to avoid reflection API or not?

Thanks
Imran
 
Balaji VR
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The local home object/interface implementations are gonna run in the same JVM as the beans are. Hence there is no need to go for EJBMetaData() method on Local Home Object. I had read through specs that also talks about, if you are interfacing through local interfaces, you could do reflection mechanisms. But Strict NO! NO! for remote interface access!

Plz advise, if I am wrong here!

Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic