Spring Boot @ Configuration

@Configuration allows you to distribute your Spring Beans across several classes and even jars.  However, with great power comes great responsibility. IMHO you should avoid as much as possible ship configurations with @Configuration inside jars. Because it creates binary coupling on Pojos instances and that has a huge blast radius. In IMHO is completely fine to have Config beans inside in your own service however we are considering a shared libs landscape thats a completely different question and IMHO the wrong move. Let's take a look how @Configuration behavior in sense of ordering and with multiple jars being loaded to the same application.

The Video

The Code

https://github.com/diegopacheco/java-pocs/tree/master/pocs/spring-configuration-order-poc

Cheers,

Diego Pacheco

Popular posts from this blog

Podman in Linux

Java Agents

HMAC in Java