Saturday, January 29, 2011

Annotation - Part of A Java Trend to Simplicity

Annotation is part of the new features in support of the general trend of Java Technology to become simpler and easier to use.

This is my simplifed understanding of annotation. Let me know if I am off the mark.
  • Developer embeds declarative "notes" in Java code ->
  • The compliler or the JVM generate related code (both at compile time or run time) ->
  • The application obtains a desired behaviors or results
This is the quote from one technical author: "Simply speaking, annotation is a mechanism for associating a meta-tag with program elements and allowing the compiler or the VM to extract program behaviors from these annotated elements and generate interdependent codes when necessary".

This is the definition from Wiki: "An annotation, in the Java computer programming language, is a special form of syntactic metadata that can be added to Java source code.[1] Classes, methods, variables, parameters and packages may be annotated. Unlike Javadoc tags, Java annotations can be reflective in that they can be embedded in class files generated by the compiler and may be retained by the Java VM to be made retrievable at run-time".

No comments: