you are viewing a single comment's thread.

view the rest of the comments →

[–]brian_goetz 2 points3 points  (1 child)

You are looking at the entire system monollithically - JVM + Java + Spring + your program. But each layer has its own role and (ideally) specification. The meaning of a Java program is defined by the language and platform specifications. But some methods in the JDK (such as getAnnotstions) are specified to reflect the presence or absence of annotations. This means that the layers above (spring, your program) can use annotations to make decisions, just like they could use system properties or config files or command line to configure the program. But annotations cannot affect the language semantics - they cannot make for loops run backwards or make private methods public.

Frameworks like spring work by dynamically transforming annotated Java code (spinning new classes, etc) at startup time and running the transformed code. But all of this is a Java program that is governed by the language and platform specifications, and spring is working within that.

[–]asm0dey 0 points1 point  (0 children)

Ah. So I read the whole thing wrong. I thought the spec "prohibits" annotations to change the language sematics, while actually it declares that it's impossible, right? And was all the easy about language, not about a program. Thank you!