Annotations

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Current revision (04:48, 5 August 2009) (edit) (undo)
 
Line 1: Line 1:
[[Annotations]] can definitely be an API. At salesforce.com, we have a dynamic language that we
[[Annotations]] can definitely be an API. At salesforce.com, we have a dynamic language that we
develop in-house. Many methods for standard objects in this language
develop in-house. Many methods for standard objects in this language
-
are implemented in [[Java]], and annotated to generate (just like described in [[CompileTimeCache]]s?) the method signatures
+
are implemented in [[Java]], and annotated to generate (just like described in [[CompileTimeCache]]s, using [[AnnotationProcessor]]s?) the method signatures
in Apex. The [[annotation]]s are literally the library API.
in Apex. The [[annotation]]s are literally the library API.

Current revision

Annotations can definitely be an API. At salesforce.com, we have a dynamic language that we develop in-house. Many methods for standard objects in this language are implemented in Java, and annotated to generate (just like described in CompileTimeCaches, using AnnotationProcessors?) the method signatures in Apex. The annotations are literally the library API.

Similarly, Hibernate can use annotations to specify mappings between the DB and entity objects. It's an API for communication between the DBA and logic programmer.

Annotations are often used in lieu of XML configuration files (in spring, hibernate, tapestry, etc.) There are many cases of projects using annotations to get rid of "XML configuration file cruft" (as they see it). Therefore it's likely the general case that annotations are an API in the same way that XML schemas are.

--RichUnger Thu Mar 27 21:10:09 PDT 2008

Personal tools
buy