User loginNavigation |
Reflection in Java: how are they getting with it?
We seem to discuss pretty specific issues lately, so I feel I can bring this one up.
For a PL in which dynamism is one of the selling points, Java has pretty bad support for reflection: reification/introspection/intercession trio. Reification is crippled by fact that not all concepts have representation, accessible to programs - the one for bytecode (literally an array of bytes) is a joke. This can be helped by libraries, though, and indeed is. Introspection is limited - for bytecode as well (a program cannot in general obtain a representation of bytecode for the object at hand). That's a more serious limitation, although there are ways around it if you are willing to make some assumptions. Intercession has another twist - on a positive side, it's possible to obtain classes from bytes (though it was not possible the other way around - funny, eh?), but on a negative side, while introspection had structured representation for some concepts (like fields), intercession knows only byte arrays. Ugh. I will skip my complaints to representation of invocations, call stacks and threads, as the post is already quite negative. To drive this towards PL design: how did Java get there? Was it because in early years there was little use for reflection? Why wasn't it fixed? Is it a scientific problem, an engineering one, or maybe cultural? How can newly designed PLs avoid such a fate? PS: For some users reflection and MOP may be something very esoteric and unpractical, but look at Java "enterprise" open source projects: most of them are just grown from one or other attempt to overcome these deficiencies of the language. Unfortunately, there is a limit on what libraries can do to a PL. By Andris Birkmanis at 2005-03-19 12:58 | LtU Forum | previous forum topic | next forum topic | other blogs | 11576 reads
|
Browse archives
Active forum topics |
Recent comments
12 weeks 1 day ago
12 weeks 1 day ago
12 weeks 1 day ago
34 weeks 2 days ago
38 weeks 4 days ago
40 weeks 2 days ago
40 weeks 2 days ago
42 weeks 6 days ago
47 weeks 4 days ago
47 weeks 4 days ago