Re: Literature about reflection

Daniel Vogelheim <Daniel.Vogelheim@post.rwth-aachen.de>
20 Sep 1999 12:01:15 -0400

          From comp.compilers

Related articles
Literature about reflection Daniel.Vogelheim@post.rwth-aachen.de (Daniel Vogelheim) (1999-09-10)
Re: Literature about reflection emarsden@mail.dotcom.fr (Eric Marsden) (1999-09-11)
Re: Literature about reflection Daniel.Vogelheim@post.rwth-aachen.de (Daniel Vogelheim) (1999-09-20)
Re: Literature about reflection emarsden@mail.dotcom.fr (Eric Marsden) (1999-09-24)
| List of all articles for this month |

From: Daniel Vogelheim <Daniel.Vogelheim@post.rwth-aachen.de>
Newsgroups: comp.compilers
Date: 20 Sep 1999 12:01:15 -0400
Organization: Aachen University of Technology (RWTH)
References: 99-09-028 99-09-039
Keywords: Java, analysis

Hello Eric and group,


> dv> I'm looking for literature about reflection (as in: Java 1.1
> dv> reflection API). Something that concisely explains what it is
> dv> and informs about alternatives and different approaches to the
> dv> problem.


>You can start with [1], and a number of the articles at [2]. [...]
>You could also do a literature search for "metaobject protocol" [...]
>The literature on open languages/compilers is relevant too.


Thank you. Those references were exactly what I needed.


>Note that
>the Java "Reflection" API only allows introspection (the metalevel
>observes the state and behaviour of the baselevel), which is only one
>side of reflection, the other being intercession (the metalevel
>controls the state/behaviour of the baselevel).


I don't understand. The way I understand the literature you pointed me
at, reflection capabilities can be categorized as follows:


1) The baselevel gets read only access to the metalevel. This means,
the base level can find out about it's own structure and state. E.g.,
an object can enumerate it's own member variables, and possibly print
their values.


2) The base gets access to the metalevel, which can observe and change
the baselevel. E.g., the program can find out about the variables of
another object and change their values through the metalevel. It could
also find the constructors for a class, call them, and thereby create
new baselevel objects through the metalevel.


3) The baselevel gets full access to the metalevel and can change the
metalevel. This means, a program could create new classes, or change
the meaning of e.g. inheritance or member variable access.




I thought the Java Reflection API provides 1) and 2). 3) is not
directly supported in Java, but could be implemented through dynamic
class loaders that change the JVM Bytecodes at run time. Your comment
seems to say Java can only do 1). What is right?




Thank you,
Daniel Vogelheim


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.