Spring highly adopted annotation based configuration and it is happily accepted by developer communities and why not, no one wants to struggle with XML tags but that’s not enough somewhere we still miss XML configuration or you can say external file configuration as powerful as XML configuration. especially when we write an application that has to alter behaviors without compilation.
But still writing an XML configuration is not readable and not easily understandable for beginners, so I’ve written experimental plugins for spring boot that convert YAML definition to Spring Beans.
here is an example of bean definition in XML and same in YAML.
above code snippet, you can see a line of code and readability, let jump in a code example.
below code snippet, only need to add annotation “@ImportYamlResource” that will work same as “@ImportResource”
below an example link, you can check out a project from git
Note -> YAML-spring-beans is a just experimental library, still there are lots of features not included
feedback will be much appreciated 🙂