Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Reflection API

Ranch Hand
Posts: 77
Eclipse IDE Chrome 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?

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!

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic