Spring Functional

Writing better Spring applications using SpringFu

Writing better Spring applications using SpringFu

“Truth can only be found in one place: the code,” Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship.

The way we structure our code has a direct impact on how understandable is it. Code that is easy to follow with no or less hidden functionality is much easier to maintain. It also makes it easier for our fellow programmers to track down bugs in the code. This helps us to avoid Venkat’s Jesus Driven Development.

The way I write Spring applications comprises heavy use of Spring annotations. The problem with this approach is that partial flow of the application is controlled by annotations. The complete flow of my code is not in one place, that is, in my code. I need to look back to the documentation to understand the annotations’ behavior. By reading just the code, it is difficult to predict the flow of control.

Luckily, Spring has a new way to code to and it has been called Spring Functional or SpringFu. In this article, I will use Kotlin to showcase some of the benefits you get from SpringFu.

Continue reading “Writing better Spring applications using SpringFu”