• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Java Reflection API

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody suggest a good source of information (tutorials, code samples, books, etc.) on Java Reflection API?
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sergei,
I just pulled out whatever I have - Not sure if any of these will be of use but
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. (I assume you've already checked the API itself, right?)
 
Author and "Sun God"
Posts: 185
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sergei,
Hi. Sun has a refection tutorial. I haven't read it, but I believe it's fine.
My book encourages you to use reflection only in a limited form that avoids most of its disadvantages (Item 35, "Prefer interfaces to reflection"). Briefly, I believe that reflection should generally be used only to instantiate objects, which can then be accessed via the interface(s) they implement. The advantages of this approach are: compile-time type safety, cleanliness, and performance. Sometimes you need the full power of reflective access, but often you don't.

------------------
Joshua Bloch
Author of Effective Java
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
corejava volume 1 & 2 dwell into reflection in a good deal.
You have to be aware that using reflection will be a performance kill if you don't use it the right way.
 
reply
    Bookmark Topic Watch Topic
  • New Topic