Michael Simons - header image

Michael Simons

The Spring Interviews

Last updated on June 25, 2020 -

Who the hell am I?

I'm @MarcoBehler and I share everything I know about making awesome software through my guides, screencasts, talks and courses.

Follow me on Twitter to find out what I'm currently working on.

This interview is an excerpt from The Confident Spring Professional course.

Marco: Hi Michael! Would you mind quickly introducing yourself?

Michael: Hi. I’m Michael Simons, Software engineer at Neo4j Inc., where I work as part of the driver’s team on our Spring Integration, our Object Mapper and also drivers. We are responsible for Spring Data Neo4j, Neo4j-OGM and our news project, SDN-RX, including an OpenCypher DSL.

Neo4j is a native Graph database running on the JVM, written Java and Scala.

I’m the co-founder and current lead of the EuregJUG Java User Group in Aachen, Germany.

I’m also a Java Champion, a contributor to Spring, Quarkus and Micronaut and a couple of other open-source projects. And I wrote a (German) book about Spring Boot, called "Spring Boot 2: Moderne Softwareentwicklung mit Spring 5".

Marco: Since when do you program with Spring and how did you get into it? Do you still remember your very first Spring project?

Michael: I do program indirectly with Spring since around 2007. Why indirectly? Because I loved (and still like) the Ruby on Rails Ecosystem, but that was never feasible for my company back then. The thing that came as close as possible was Grails. Written in Groovy, based on the Spring Framework.

The first pure Spring Program I wrote in 2009… My first Spring Boot project (biking.michael-simons.eu) has been started before Spring Boot 1.0 in early 2014 and is alive and online until today.

Marco: For people new to the Spring ecosystem, what Spring projects would you recommend having a look at and in which order? Why?

Michael: Actually, I would start simple and learn about Core Spring Dependency Injection and the idea of it. It is used all over the place, starting from configuration up to your application. Learning the difference between component scanning and explicit component declaration and so on.

Also: Get rid of the idea of needing @Autowired if constructors are unambiguous. You don’t need to have any Spring dependency in your business logic.

Next step: Spring’s Testing framework: Learn that Spring is one of the easiest frameworks to test, actually.

After that: Probably going for one of the web layers, either standard MVC or reactive.

Marco: What would you say is the one thing where most developers go wrong with Spring?

Michael: Fighting against the framework: Trying to be super explicit all over the place before realizing there’s an automatism for it. If you opt for Spring and especially Spring Boot, you are making a decision for managed dependencies and auto-configuration.

Marco: What project(s) would you recommend to build in order to get more practice with Spring?

Michael: I don’t get that question. Is it after "try out writing a todo app with Spring?" If so: I’d always go with something small I need myself. For example, the biking app mentioned above.

Marco: Would you still invest time in learning Spring based on servlets and JDBC, or go straight into reactive Spring?

Michael: You can do imperative web applications with Spring without ever having to look into the fact that servlets are behind it. So, the question should be: Would you still invest time into imperative programming or go straight to reactive?

Yes, of course, imperative or "blocking" programming model is far from dead, there is absolutely no need to make reactive the default today. There are good reasons for some use cases, but reactive programming is not a silver bullet.

Marco: With the advent of client-side frameworks (React, VueJS, Angular), what’s your take on writing web applications with server-side template rendering, like Thymeleaf? Is that now legacy?

Michael: I don’t think so. I’m still a fan of server-side rendering.

Marco: What is your favorite way to connect your Spring application with a database? Would you recommend plain JPA? Hibernate? Spring Data? Any other of the 500 available choices?

Michael: What kind of database? If it’s Neo4j, please go for Spring Data Neo4j RX. It’s imperative and reactive, has full support for Kotlin, immutable objects, and much more.

If it’s a relational database, I prefer a combination of Spring Data JPA + jOOQ these days.

Marco: There are some misconceptions that Java or Spring might be slow, bloated or simply too legacy. What do you think about other choices, like Micronaut, Quarkus or even other languages like Kotlin or Scala?

Michael: I’m confident that I can write slow and bloated applications in several languages and with each and every framework mentioned here. Regarding "too legacy"? What does that mean? I think it’s great that both Java and Spring also cater to older software systems, which are still making money. Other frameworks can indeed move forward faster than Spring as they don’t have a legacy to support.

Regarding languages: Kotlin is of course a nice language and very close to Java, with more functional influx I’d say. Idiomatic Kotlin is still readable from a Java developer’s point of view (or at least not hard to learn). Co-Routines in Kotlin are part of the runtime and a different matter (I do like them a lot, actually).

Idiomatic Scala is of course different. And each step into the direction of purer functional languages makes it harder to just switch and reap immediate benefits.

Marco: Is there something you would say that Spring could do better and needs some improvement?

Michael: Nope. The Core Spring team cares a lot about inclusion and diversity, open opportunities for new contributors on all channels. They lead intellectual, honest discussions, with a really positive tone.

Also, I’m a big fan of their test driven approach, for example in the native Spring integration on GraalVM. That’s the in my opinion the right way to do it.

Marco: What is the best way to follow you and learn more about your work and what you do?

Michael: I’m @rotnroll666 on Twitter. I write about Spring, Java, software architecture and more at https://info.michael-simons.eu.

You can find me on Strava, cycling and running. On Medium, I write about my work at Neo4j: https://medium.com/@michael.simons My work is open-source, so you find most of the things I do on GitHub: https://github.com/michael-simons.

Marco: Thank you, Michael!

There's more where that came from

I'll send you an update when I publish new guides. Absolutely no spam, ever. Unsubscribe anytime.