Annotations – Don’t Mess with Java!

Over at 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.

About the Author

Matt Stephens is a senior architect, programmer and project leader based in Central London. He co-wrote Agile Development with ICONIX Process, Extreme Programming Refactored, and Use Case Driven Object Modeling with UML - Theory and Practice.