Flash Reflection package
In the ongoing work on our internal framework, this week has been dedicated to rewriting the reflection package. A reflection package in general is responsible for providing you with names for your objects.
For example if you use:
ReflectUtil.getName (Stage);
the result would be:
“Stage”
Very handy for loggers and stuff. As a matter of fact my current reflection package is the package integrated in Xray). That implementation is pretty solid & simple however some things are bothering me about it, and I have partially solved them at the moment. I don’t think it’s going to replace the simple package anytime soon, but I do know the new package rocks.
At the moment it can tell the names for all packages, classes and functions and whether a function is static or not. No references are kept between the object being reflected and the reflection object itself.
In addition methods are provided to resolve a reflected object to the object being reflected and vice versa. It includes a basic visitor implementation so to act on the class tree you no longer have to deal with all the nitty gritty details of methods, properties etc.
At the moment I’m working on optimizing the implementation and synchronizing the source after new code loads. I’m not sure whether I should override the loadMovie function for that or implement a Command queue, with a simple RefreshCodeTreeCommand.
kk back to work now, I’ll post the result to the flashcoders list when it’s done.