After interviewing Jeroen, it’s time to introduce you to our fourth VCI, Nico Van Belle. Nico is an IT consultant at XTi, part of Xplore Group. He is a Java and Node.js architect with over a decade of experience in multiple industries. He values best practices, pragmatism, building stable solutions, and “using the right tool for the job”.
Nico, when was the first time you came into contact with the Spring framework? And what was the context in which you started using Spring?
“That was about 10 years ago during my first experience as a Java consultant at the Cronos Group. I used the Spring framework in almost all of the projects I worked on up until now. There was only one project in which we didn’t use Spring. The technical lead at the company we were working for was actually an ex-colleague of mine, so I knew him quite well. I knew that he likes sticking with Java standards such as Enterprise JavaBeans, so they didn’t use Spring in that company. But that’s an exception, all the other projects I worked on up until now are based on Spring. That’s because Spring has become quite popular, and most companies like to use a framework that most people already know. That makes it a lot easier for new developers to get up to speed, because they can immediately read and understand the code.”
What was your first impression of the Spring Framework at the time?
“I thought it was super cool. (laughs) Before I started working at XTi, I worked in a company that didn’t really have its roots within software development. It was more of a side branch of industrial IT. We didn’t use dependency injection during my time there, we used pure Java SE. You can actually use dependency injection in Java SE now, but that wasn’t possible yet at the time. So Spring introduced me to a lot of new concepts, and it was awesome that I could inject something via an annotation without having to create it again every time.”
How do you experience working with Spring during your day-to-day job? Do you see certain advantages or disadvantages?
“Spring is constantly evolving, and because it is such a big ecosystem that keeps on adapting and innovating, you have everything you need available within the framework. Well, at least most of the time. (laughs) The fact that Spring, by default, uses the Singleton pattern for its beans makes things a lot easier, because you don’t need to think about how other beans are going to interact with your bean. And, for 99% of the time, singleton is what you need. If you go to Stack Overflow and look for standard Java annotations (EJB/CDI) you can place on a bean, there are always a bunch of questions about it. People find these annotations to be very confusing, and Spring eliminates that confusion. So Spring makes a lot of things easier for developers, and that’s great. It’s also easy to get started as a beginner, because the Singleton pattern is the easiest design pattern. So even if you’re not that good with design patterns, it’s likely that you will understand the Singleton pattern.”
If you had to pick a favourite feature of the Spring Framework, which one would it be?
“What I find cool about Spring is that it doesn’t require you to deploy your application to big, bulky enterprise applications servers. You’re able to deploy your application to smaller servlet containers like Tomcat or Jetty because Spring manages its own beans. That’s not a new feature, but it’s still awesome after all these years. The fact that Spring works on those much smaller in size web servers allowed it to package them into the final build artifact, which made it possible to develop an executable JAR file. If someone who has Java installed executes that JAR file, it will start up the packaged servlet container on which the application then can run automatically. This feature also makes it easier to deploy your application to Kubernetes, because you don’t need to provide this server in your Kubernetes Pods anymore.”
How do you see the Spring Framework evolve in the future?
“Spring recently released a beta version of Spring Native, which makes it possible for developers to use Spring in Kubernetes Pods for example, and specifically in Pods that need to start up very quickly. Quick start-up times are often required to enable autoscaling and serverless computing, or to use AWS Lambda, to name a few examples. A fast start-up is very important for these applications, and Spring used to be quite a bad choice for that. That’s why alternatives like Quarkus emerged. But this problem has now been solved with Spring Native, and the beta version already looks promising. Just the fact that Spring will become an option for serverless computing again is amazing. I believe they will pay more attention to that in the future.”
Can you give us a useful tip for people who want to get started with Spring?
“I think it’s very important to start from the beginning. Most developers know that they should read the documentation, but don’t take the time to do so. We’re all the same. (laughs) When I’m teaching a course, I can tell if someone hasn’t read the documentation from the questions they ask: those who haven’t often don’t know enough about the basics yet. For example, we put a lot of emphasis on the Spring lifecycle during the Spring Core course, because it’s a concept you really need to grasp before getting started. It’s not a bad idea to go through the documentation so you can identify the biggest pitfalls before you start working on a Spring project.”
Before we wrap up, is there anything else you would like to add? Maybe you have a fun fact about Spring that you would like to mention?
“There is, actually! We used to have a running joke while working on a certain project for a client. For example, if we needed to migrate a database to a new table structure or poll files in a directory, we’d say: ‘just write a small Java program’. (laughs) And that’s actually what we did most of the time. The good thing about Spring is that it makes it quite easy to do that. Spring Boot in particular allows you to set something up that works out of the box very quickly, thanks to all of the sensible defaults Spring provides for you. That’s a lot of configuration you don’t need to do yourself. You can write such a ‘small Java program’ in just about 3 or 4 hours, and for me, that’s what makes it a lot of fun to work with Spring.”