Posts

Showing posts with the label Configuration

Configuration Ownership

Image
  Building software at scale is tricky, and when you have lots of software, you have more problems to solve. Several times engineers look for ways to make their lives easier: make it simple, transparent, and easy to use. That sounds like a good idea, right? What can go wrong with that? Typing is never the bottleneck and will never be. We are all obsessed with reuse; several times, the reuse is marginal and brings way more problems than benefits. Working with an Object-Oriented Language such as Java makes a lot of sense to leverage Dependency. Injection and Ioc(Inversion of Control). Because it's easier to test the Application and also easier to change the Code. In the past, Spring Framework was all about XML; today, all configuration is pretty much done via Code. It's possible to use property files to configure some aspects of backend services written in Java with Spring, yes, but in reality, most of the Code is in the Code in the form of Java Spring Beans.  Spring Framework ...

Spring Boot @ Configuration

Image
@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.

@Value and Spring Properties

Image
@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!

Idea: Configs and Stream Debug

Image
I work with Java for a long time. I always used eclipse. I like eclipse IDE. However I need to admit eclipse is pretty much dead, specially scala IDE wish I used a lot but unfortunate is long dead. So IntelliJ Idea is alive and has some interesting features like being alive first of all and also easily I could say performance is pretty good and you dont want need to install lots of plugins. So I made a video showing some configs that will make your life easier if you came from eclipse like me and also share some killer features for Java Streams Debug. I always like eclipse but I dont have issues using Idea, I believe 2 things. First of all changing editors, IDE is always good for experience and open your mind and secondly, you should not be attache to any language, IDE, editor or tool, these things are tools and there is the best too for the jobs, this tools dont define you and you are bigger than this tools. So the tools should serve you and not the other way around.  So Let's ...