Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diff. between Introspection and Reflection

 
Abrahim Daver
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are introspection and reflection and what are difference between them, Can someone elaborate these two points.
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to the best of my knowledge, there is no difference between them; i have always understood the terms to be synonyms. that said, in Java the word "reflection" seems to be the preferred one, the word "introspection" seems more popular among users of some other languages.

what the thing does is let you operate on the structure of classes. Sun has a tutorial on the topic, and it is also mentioned in the API.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I muddled another thread by confusing them. The words may be synonomous in the real world, but Java seems to have formalized Introspection to mean some mechanisms you can use to inspect JavaBeans, and reflection to mean some lower level inspection of classes. See JavaDoc for Introspector and Class to see if that distinction holds up and makes sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic