What is the origin of the term reflection? It seems more like introspection. Why isn't it called that?
Introspection: A looking inward; specifically, the act or process of self-examination.
Reflection:
Summary: 1. The term reflection denotes the act or state of being reflected while introspection has to do with the observation or examination of one's own mental and emotional state of mind.
Reflection is a personal process that can deepen one's understanding of self and can lead to significant discoveries or insights, while self-assessment is a process that involves establishing strengths, improvements, and insights based on predetermined performance criteria.
Introspection is concept of querying any reference (Object) RUNTIME for its type/class /method details .. Reflection is Java API which provides this ability . This is normally used when you want to deal Objects having No Type information available till Runtime (say for example Objects passed by External systems)
Reflection is a mechanism composed of two techniques : Introspection. The ability for a program to examine itself. Intercession. The ability for a program to modify itself (his behaviour or his state)
There is an interesting answer on the french wikipedia article for Reflection (here)
Reflection can be decomposed in two parts:
So reflection is a 'stronger' property than introspection. That's why you say type introspection for the ability to know types at runtime (and changing them is another action: conversion/casting).
EDIT: actually I just realized the first answer was saying exactly that ^^. Time to unplug myself...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With