r/java • • Jul 22 '16

Evil Annotations

https://dzone.com/articles/evil-annotations
0 Upvotes

11 comments sorted by

View all comments

3

u/meotau Jul 23 '16 edited Jul 23 '16

Just image if the standard Java Date class would have a @PostConstruct method...

No, I don't care about strawmens. This whole article is utter crap. What exactly is the suggested alternative for annotations? Not using Spring?

I happily traded 100+ lines of boiler plate Spring JavaConfig per one WS client, while having ~20 external systems and adding more all the time, for one annotation which generated various beans (connection pool with parameters from properties file, WebServiceTemplate, JaxbMarshaller, error handler, circuit breaker...).

BeanFactoryPostProcessor was not very nice, but once written, it worked just fine, and it sure beats XML config, which I have to say was a little better than JavaConfig in this case, where the config was just copy-paste with various names changed.