• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reflection Vs inspection

 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic