[Grace-core] visibility and reflection

James Noble kjx at ecs.vuw.ac.nz
Sat Aug 4 04:49:32 PDT 2012


> Certainly private methods should not be accessible.  I have mixed feelings about confidential.  Do we want reflection to be able to define a subobject of an existing object (with unknown type).  If so, then we will need to be able to find the confidential methods. On the other hand, my gut tells me that the should not be visible from outside.  What do others think?

I think it depends on the use that reflection is supporting. 
If reflection is being used in a relatively "normal" (base-level) program then those restrictions make sense.
But even in a testing framework - do programs ever need to test confidential or even private methods?
If so, there needs to be some mechanism to call them, presumably via reflection.
What about a debugger?  If that's implemented using recursion in the same memory space,
them presumably we'd need to read even private variables and call private methods.

James


More information about the Grace-core mailing list