Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreHi Spring fans! Happy New Year! And welcome to another installment of This Year in Spring!
I write this edition from a desk overlooking the beautiful jungle of Martinique, a beautiful island nation in the French Caribbean. I’m sipping some rhum martinique, enjoying the semi-sweltering heat, and thinking about the year that's been 2024. Every year at this time, since 2011, I write this year in spring, an abbreviated look at the year from the rearview mirror.
So many amazing things happened this year. It’s sort of difficult to put my finger on any one thing. But, I shall try to narrow it down. To five items. As I always do.
We’ll have the week's roundup below, too, as usual.
So where to begin? Remember, this is meant to be a roundup of the things that most impressed. The things that most took my breath away. Not a roundup of the latest of a given thing. And there have been a ton of amazing things that fit the bill. Let’s dive right into them.
C’mon. You saw this coming. I’m a contributor to Spring AI, for Pete’s sake! It’s super good and getting better by the minute! Spring AI is a comprehensive framework for end-to-end integration of the common patterns of AI engineering. It provides robust support for building AI-powered systems and services through the use fo the four pillars of Spring: AOP, portable service abstractions, dependency injection, and auto-configuration.
And, it's even at the leading edge of a ton of new and amazing protocols, MCP - Model Context Protocol - which lets you integrate arbitrary data sources with your LLM models. Spring AI MCP is (at least for the moment) a subproject of Spring AI making it trivial to both produce and consume MCP services.
In Chinese, the word for 'love' is ai. The word for ‘I' is 'wo'. So: wo ai AI!
Look, one of the biggest pet peeves of mine is that I see so many codebases which sort of fly in the face of good object-oriented design, using package structures like app.controllers
, app.services
, app.models
, app.repositories
, etc. In order for this scheme to work, every type (save perhaps the controllers) would need to be public
. Why?_ this is an anti-pattern! Why use a nice object-oriented language if you're only going to make everything public? The whole point of object orientation is information hiding. If you want everything to effectively be public, in a flat global namespace, just use C! At least that's a bit more honest.
But what are the alternatives? There are tons of other approaches that/will guide you to cleaner architecture, and one of my favorites is Spring Modulith. Spring Modulith gives you the tools to build clean, modular codebases with Spring. It extends the framework, adding infrastructure to make modular decoupling easier. And, through the use of conventions and tests backed by ArchUnit, it lets you extend the Java language with a new layer and level of validation to ensure you don't inadvertently expose implementation details from one root package (a "module") to another.
Trust me (I’m a contributor for a reason!): Once you've gone Spring Modulith, you won't want to go back! Your code will be cleaner and better architectured for the long term and you'll have more confidence that you're not accidentally making promises you can't keep to other would-be dependents!
This is a new experimental project (but it's on the Spring Initializr!) that lets you quickly and easily stand up GraalVM-ready gRPC services with Spring Boot! You just define your proto service definitions in the proto
folder. What else do you need to know? Go to start.spring.io, choose gRPC, and hit generate. Build the project using your build tool and it’ll generate the stubs for your services, which you then implement in a Spring Boot project. If you run the resulting jar in the usual way, it’ll bind the gRPC in the usual way to a port directly. If you have spring-boot-starter-web
on the classpath, it’ll expose the gRPC service through the servlet infrastructure. If you have Actuator, it'll give you metrics about your services. And, soon, if you are using spring-boot-starter-security
, it'll let you secure your services. And of course, if you selectgraalvm
on the Spring Initializr, it’ll let you compile the applications into a GraalVM native binary! Nice. Try it out now (and I'll be doing a video in the new year!)
I can't tell you how impressed I’ve been with Spring Security of late. It’s already a one-stop-shop for all things security, authentication, and authorization. But it keeps getting easier and more awesome. This latest release - 6.4 - includes new or enhanced support for:
And remember, Spring Authorization Server is getting better and better all the time, too! The newest release makes standing one up trivial. It’s basically a one-liner for the common cases! You can even mix-and-match: have a Spring Authorization Server that lets people redirect OAuth clients to handle authentication and then let them authenticate using their fingers or magic links or whatever. Amazing!
There’s an incredible opportunity implied in using a framework like Spring, because it sits between you and the lower-level runtime, which means that if we - the folks working on Spring - can optimize things at the framework level, we can do so and advantage everyone using the framework. It’s too good a fruit to resist! So we're always looking for levers we can pull that improve your application. And this year is no different.
This year, we took our efforts even further. You may know that we have great support for Project CRaC in Spring Boot. We also have amazing support for GraalVM native images. This year we debuted our integrated AppCDS support and previewed our Project Leyden support. I did a video covering all of these options except Project Leyden here. For details on Project Leyden, check out this video, which was presented at Devoxx Belgium in cooperation with the Java team at Oracle.
Vroom!
All right, with those five tentpole marquee features introduced, let's look at..
Here's your usual dose of goodness from the last week of the new and novel in this the most amazing community ever!
I speak, I'm sure, for the entire Spring team when I say to you: HAPPY NEW YEAR, and we look forward to seeing you in 2025!!