r/java • u/olivergierke • Dec 26 '25
Evolving Spring Vault: Introducing VaultClient
https://spring.io/blog/2025/12/26/evolving-spring-vault
32
Upvotes
r/java • u/olivergierke • Dec 26 '25
View all comments
Show parent comment
1
u/UnGauchoCualquiera Dec 29 '25 edited Dec 29 '25
They really are templates at the core. RestTemplate, for example has protected methods like doExecute and handleResponse methods that can be overriden to extend functionality in a generic way.
It's explained in the article but summarizing the article the template API pattern dates to the very origins of the Spring framework.
A lesson in history, Templates pre-date Java 8 and lambdas by a long shot. For example, JdbcTemplate is almost 25 years old. At that time if you wanted to pass some sort of asynchronous callbacks you had to delcare an annonymous class. The Template pattern was a solution to that verbosity.
Spring developers seem to have taken lessons learnt from experience and newer language features and are now seemingly moving into more fluent like APIs with interceptors as an extension point.