Seems like a few people agree with my concerns
on annotations overkill. And a quick note to Annotation zealots out
there - my previous post was not indended in any way as a cricism of
annotations per se
- it was purely that the overuse of annotations is bad.
Even the really simple
hello-world style examples of EJB3 look quite annotation-smelly to me
and thats without any kind of transaction, local/remote, WS or
persistence configuration stuff. Plus you can bet different containers
are gonna start using their own
annotations to add extra information for when POJOs are deployed in
different kinds of containers - these things are gonna multiply like
crazy. You can have
too much of a good thing :)
This is not about XML config files versus annotations. Its about better
way to manage the use of annotations so our Java source files don't
turn into a gibberish mess of gazillion annotations to support every
flavour of container.
We can use naming conventions and/or annotations with AOP to actually
introduce annotations using sensible defaults. Kinda like using
annotation macros to do the sensible things that developers want to do
without typing in and maintaining all of those annotations by hand.
e.g. a single @MySession annotation could default all the various
transactional, remote/local, inject/webservice annotations using the
full monty heavy weight J2EE annotation models.
So, I wonder is it time for us to consider lightweight annotations? :). Cedric, I think you're EJB3 annotations look fat :)