Good morning. Does anyone know which version of sp...
# spring
l
Good morning. Does anyone know which version of spring introduced the beans and routing kotlin DSLs ? https://docs.spring.io/spring-framework/docs/current/reference/html/languages.html#kotlin-web
n
i think it was 5.0 ping @sdeleuze for confirmation
actually, not necessary the javadoc confirms:
Copy code
* @author Sebastien Deleuze
 * @see BeanDefinitionDsl
 * @since 5.0
s
Yep indeed
n
sorry seb 😅
s
Np
l
Thank you! I didn't find it 🙂
I'm writing an article about it, with some benchmarking compared to standard annotations
👍 1
t
do you care only about performances? a while back I looked into functional routing for webmvc but there were some missing features, I think spring hateoas was not working (ofc I might be wrong, memory might not serve me right). or it was automatic swagger generation with springdoc (third party library). I guess what I wanted to say is, you might want to investigate also functional limitations compared to annotations approach
s
See https://springdoc.org/#spring-webfluxwebmvc-fn-with-functional-endpoints for OpenAPI, that would be interesting to have a Kotlin sample of that in the blog post.
The project lead is pretty reactive if you need more info for the Kotlin version you can maybe ask on https://github.com/springdoc/springdoc-openapi/issues to add a Kotlin sample in their doc.
Even if quiet for now as most of my time is on Spring Native, check https://github.com/spring-projects-experimental/spring-fu to see the functional vision fully leveraged.
From my POV the programming style is more imprtant than performances. Performances mainly comes from the explicit nature. Unlike what more people think, reflection and classpath scanning done right are fast on the JVM.
But yeah in the end performances are usually better with Spring Fu style apps.
l
yes, I also prefer the DSL for the style... not for performance
Indeed the benchmark doesn't bring any evidence of better performance if no CGLIB is in place
s
Yeah Spring Framework and Spring Boot are well optimized. Usually what make Spring Fu faster is that you enable less infra.
l
if I understood it well, the DSL should enforce a coding style that let's you avoid CGLIB completely
s
CGLIB proxies are already disabled on regular Spring Boot configs via the
proxyBeanMethods = false
attribute. Only used for proxies on classes for transaction, security, etc. Spring AOT incubated in Spring Native (https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#spring-aot) will allow shortly to create proxies at build time.
l
The main doubt that I have is about how well it integrates with spring security. And also if in this case it is possible to avoid CGLIB proxies
s
Yeah integration is not fully done for advanced features like Security. This is what we intend to incubate in Spring Fu.
👍 1
l