ANNOTATION IN JAVA

[Pick the date]

By martin_m_nad@yahoo.com

Anotation in java

Annotation in java
[TYPE THE SUBTITLE]

ANNOTATION
Annotation is a kind of the metadata. Here I will discuss how you can use Annotation in your java application and why. Metadata is a way to describe your data, or in other why metadata is a definition of your data, or in more generally way data about data. XMl is another way to describe your data. And in generally you use annotation in java and replace your xml files, for example you can look at the Hibernate to how you can use annotation instated xml-file. Xml is very good way to describe your information with it, but because it is define in other files, outside your source code, and there are not any tools to check your application filenames with those names in xmlfiles, I would rather to use annotation to describe my data in my javaapplication. Annotation can be used by compiler, precompiler , and at the runtime by using Reflection.

There are 3 benefits to use Annotation in your application: 1- For Generate Documentation 2- For compiler checking 3- For Code analysis

Page 2

Anotation in java

I’m sure that you have got problem suddenly your application doesn’t work anymore, And you are looking and spend lot of time to find what is wrong with your codes. Overridden is metadata that you can use in your java-code and very soon you can find this kind of problem and error in your application. Another useful metadata is Depprecture, it is about a function that it is not support in next generation of source-code.

Annotation can help you for code-analysis, you can ensure that you are using right type of parameters and will get right value/values form a function too for example.

There are three different kind of annotation: 1-Mark annotation, without any variables, as @overriden 2-single annotation, just with one variable, as @soemannotation(“some value”) 3-complate annotation, with more than one variable @someannotation(parmeter1=”p1”,paramtere2=”p2” …)

To be continue….

Page 3

Anotation in java

MY OTHER PAPERS
Properties in Java and Spring by Martin Nad Spring and Cxf by Example Jboss and Perm Gen Error Using Ftp Service With Spring JunIt How to use Maven ReFactoring Maven and Custome Archetype How to Write Effective Code Using Generic in Java Why and where Java Caching what is new in java 5

Page 4

Sign up to vote on this title
UsefulNot useful