Why is reflection called reflection instead of introspection?

What is the origin of the term "reflection"? This is like introspection. Why is this not called?

Introspection : look inside; in particular, an act or process of introspection.

Reflection :

  • an act of reflection or a state of reflection.
  • picture; performance; copy
  • fixing thoughts about something; scrutiny
  • thought arising from consideration or meditation.
+75
language-agnostic reflection
Dec 09 '08 at 2:09
source share
6 answers

There is an interesting answer to the French wikipedia article for Reflection ( here )

Reflection can be decomposed into two parts:

  • introspection: the program can test itself.
  • intercession: the program can change its state / value.

Thus, reflection is a “stronger” property than introspection. That is why you say introspection type for the ability to know types at runtime (and changing them is another action: transform / cast).

EDIT: in fact, I only realized that the first answer was talking specifically about ^^. Time to turn yourself off ...

+58
Dec 09 '08 at 3:03
source share

Reflection comes from the idea of ​​"introspection, self-modification and self-replication", reflecting one "I" with the goal of change. In programming, you use reflection to study the structure of the program itself in the context of its use, and not just to study it. What you get is a representation of a program that you can use to change it, not the data that it runs on.

More information can be found in the wikipedia article. .

+26
Dec 09 '08 at 2:30
source share

There is another concept called type introspection, which refers to the ability to determine the type of an object at run time.

edit: I understand that your question was supposed to be a language agnostic, but in Java, reflection is used to determine which members the object has, while introspection allows you to determine what JavaBeans properties the object has, so the introspection of the class is in the java.beans package . I'm not sure that the exact difference between these words will be in other languages, but

+4
Dec 09 '08 at 2:18
source share

The term “reflection” refers to the 1982 Brian Cantwell Smith dissertation, which can be found at http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-272.pdf

What has come to be called reflection is often just introspection, that is, access to metadata. Smith for thought included a causal link from the metadata back, and this is usually the missing component. One way to imagine reflection is through access to an implementation, not just the implementation of some new instance of computation, but by calculating access to its own implementation. Of course, the original reflection of the api in Java was incorrectly named, because in this sense it was not reflected.

+3
May 27 '13 at
source share

In .Net, I think the term Reflection is very appropriate, because it is not the type itself that is being considered, it is a manifest of the code, which is just a description.

+1
Dec 07 '09 at 13:31
source share

Reflection, in the sense of Definitions 3 and 4, may be introspective. That is, introspection is a reflection of one self. I believe that introspection is the best word to use to analyze the code, because the word is more specific, but I don’t think that reflection is completely inappropriate.

+1
Dec 07 '09 at 13:41
source share



All Articles