International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 16 - Number 8 |
Year of Publication: 2011 |
Authors: Shiva Prakash, J.P. Saini, R. K. Singh, Karan Singh |
10.5120/2034-2391 |
Shiva Prakash, J.P. Saini, R. K. Singh, Karan Singh . Features of Annotations and their Applications. International Journal of Computer Applications. 16, 8 ( February 2011), 14-21. DOI=10.5120/2034-2391
Annotations are descriptive declarative information that can be associated with program elements. They can be used to represent metadata. This is useful in many cases like providing documentation, connecting to database etc. These annotations are later read by the execution environment and appropriate action will be taken. For custom annotations, a process called reflection is used to take necessary action. Although Java introduced this feature recently, attributes / annotations have been a topic of interest for researchers. There are tools and applications which make use of annotations. This paper, we will first have a look at annotations and annotation types. Then we go on to discuss in detail how annotations support injecting dependencies into resources like data sources, mail sources, environment entries, EJBs, web services, and so on. The new features are targeted to shift the responsibility of writing the boilerplate code from the programmer to the compiler or other tools. The resulting code is less likely to be bug-prone.