Annotations – Don’t Mess with Java!
- By Matt Stephens
Over at SoftwareReality.com we’re running an article about one of the lamer features introduced in Java 5: annotations.
Java 5 brought with it a host of exciting new features: generics, enums, autoboxing and so forth. Annotations are sort of like the low-scoring sibling in a family of high achievers: the one that the family tries not to talk about too much, because his Half-Life frag rate is so embarrassingly low.
Unfortunately, Sun does talk about annotations quite a lot, and they don’t appear to have noticed that this particular new language feature is actually a bit ill-conceived. The EJB 3 spec makes heavy use of annotations, which suggests that the EJB design mentality has been allowed to pollute the core Java language.
The article explains what's essentially wrong with annotations, and also suggests what would have been (or could be) a more suitable alternative.