• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection Vs inspection  RSS feed

 
Chandra shekar M
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


What are the differences between inspection and reflection?
i found inspection is static and reflection is dynamic introspection. But not sure how?

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess that you really mean "introspection" instead of "inspection".

"Introspection" is for Java beans; see the package java.beans. It is a higher-level API than the reflection API to find, get and set properties of Java beans etc. It uses the reflection API behind the scenes.

Why do you think that introspection is static, while reflection is "dynamic introspection"? What exactly do you mean by that?
 
Chandra shekar M
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

below is the quote extracted from javaworld tutorial
There are two ways to deal with introspection in Java: class file inspection and the new reflection API that is part of Java 1.1.x. I'll cover both techniques


and the link to the same webpage


 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha. Note that that article is from 1997, which means that nowadays it is ancient. It's talking about Java version 1.1...

It also seems to confuse the words "inspection", "introspection" and "reflection". With "inspection", it looks like they mean disassembling *.class files to see what's in there. You can do that with the javap tool which comes with the JDK.

Don't worry too much about the terms and explanations in that article. These are not really things that are very important to understand, and the article is old and sloppy anyway.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!