6 ms·
I consider @Autowired and bean config in code as harmful. It also seems like one of the main things Spring was all about n the beginning - decoupling your appli
by jonhohle 13y ago
I consider @Autowired and bean config in code as harmful. It also seems like one of the main things Spring was all about n the beginning - decoupling your application from the configuration framework - is now come full circle to tight coupling with Spring. Not only that, but code which references config files for one spaghetti mess of code and config that is a pain to test. More and more I run into library packages with direct dependencies on Spring config - and it makes integration painful.
I'd be happy to see Spring config in a format other than XML (JSON, YAML, whatever), but even more than that, a complete elimination of any Spring config directly in Java files.
- karlmdavis 13y agoThe latest Spring release supports a Groovy DSL for configuration: http://docs.spring.io/spring/docs/4.0.0.RELEASE/spring-framework-reference/htmlsingle/#_groovy_bean_definition_dsl http://docs.spring.io/spring/docs/4.0.0.RELEASE/spring-frame...
- vorg 13y agoGroovy? Another reason not to use Spring.
- MoosePlissken 13y agoWell, you can already do java based config, which is not the same as annotation based config. As with XML config, Java based config lives outside of your application code in classes dedicated to configuration. You just use Java instead of XML, which makes things much nicer. See here: http://docs.spring.io/spring/docs/3.2.7.BUILD-SNAPSHOT/spring-framework-reference/htmlsingle/#beans-java http://docs.spring.io/spring/docs/3.2.7.BUILD-SNAPSHOT/sprin...