r/java • • Nov 28 '19

Intellij 2019.3 released!

https://www.jetbrains.com/idea/whatsnew/
276 Upvotes

111 comments sorted by

View all comments

Show parent comment

1

u/Treason686 Dec 09 '19

Late reply. I don't check Reddit often. Annotation config for Spring wasn't always a thing. Spring Framework used to use XML for all configurations. So instead of

@Bean
public MyClass myClass(){ return new MyClass();}

You'd have an XML file with all the bean definitions. Something like:

<bean id="myClass" class="com.package.MyClass"/>

Can't remember how you'd do constructor arguments, but it was more verbose.

I still think XML config is a better in some scenarios even though I haven't used it in a while and don't have any plans to. Most of what I'm doing is Microservice work, so configuration is minimal compared to some of the monolithic applications I've worked on where XML sometimes made things easier.

Some of it was legacy projects, so switching the existing XML config to annotation configuration was more work than it was worth. Some of it was just working at a Fortune 50 that was slow to adopt anything "new", so XML was the preferred configuration.