Earlier the configurations used to be in hard coded in the code, later it was externalized to .property files (for sake of avoiding hard coded values, avoiding changing code for the sake of changing configurations..etc) then it moved to XML (for sake of being more standardized, error free..etc)
Now, while reading about @Configuration in Spring 3 , looks like we are again moving back to the initial approach.
Why would we want to hard-code configurations in the code rather than having it externalized ?
There are some advantages
There are still people who like XML configuration and continue to do it.
References: Java configuration advantages Some more reasons