@Value annotation allows you to inject either values or results of expression into fields or even methods and constructors. Spring has several mechanisms to deal with configuration and dependency inject. IMHO for Services is more them fine to use all these features, however for libraries we need to be extremely careful and I would say you don’t want to use any of these capabilities. We also need to be careful about versioning properties inside jars, especially for libraries. It’s very easy to get unpredictable behavior. So great powers require great responsibility and thinking beyond anything I made a video showing some of this feature and also some simple POC — so let’s get started!
Originally published at http://diego-pacheco.blogspot.com on April 29, 2021.