Why the annotation processing API ?

Stéphane NICOLAS steff.nicolas at gmail.com
Thu May 26 16:14:14 UTC 2016


Thx Joe, I will read the paper in the next few days. It's been a while I
didn't read a research paper on Java ;)

2016-05-26 9:07 GMT-07:00 joe darcy <joe.darcy at oracle.com>:

>
> On 5/25/2016 9:32 PM, Stéphane NICOLAS wrote:
>
>> Hi folks,
>>
>> I know a simple mail like this generally has very minimal value. But
>> still, it's been around 2-3 years now that I work on Android, doing a lot
>> of work around reflection and annotation processing.
>>
>> I don't like the annotation processing API. I still find every concept
>> hard to remember, and it is always taking time to get immersed into it for
>> a new project.
>>
>> Thus, I don't understand, very humbly and very honestly, why this API
>> even exists. Why can't we simply use reflection-like APIs ? It would not be
>> that complex to expose an API that looks like reflection (read-only of
>> course, no new instance of classes, to method calls or setting/getting
>> field values, just the discovery part).
>>
>>
> The core reflection API has a number of serious design flaws, for a
> detailed discussion see
>
> Gilad Bracha and David Ungar. Mirrors: Design Principles for Meta-level
> Facilities of Object-Oriented Programming Languages.  In Proc. of the ACM
> Conf. on Object-Oriented Programming, Systems, Languages and Applications,
> October 2004.
> http://www.bracha.org/mirrors.pdf
>
> With the benefit of hindsight, these problems were avoided in the language
> model portion of the annotation processing API, javax.lang.model.
>
> Cheers,
>
> -Joe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20160526/b0ff8ea2/attachment.html>


More information about the compiler-dev mailing list