• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Kotlin gaining traction

 
Ranch Hand
Posts: 85
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is no wonder that Kotlin has some good tooling as it is from the Jetbrain  house, and it is also  gaining lot of traction  
in the enterprise community ,also there's been a talk on Spring moving to Kotlin in the future releases.
How do you view this ?

Thanks
Sathya

 
gunslinger & author
Posts: 151
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring has great support for Kotlin. You can use Kotlin classes as Spring beans, and Spring defined a series of extension methods that make the coding simpler. It even defined a DSL for bean configuration and a DSL for defining routing functions for reactive services.

There's an interesting design consideration involved, however. In Kotlin, all classes are final (i.e., can't be extended) by default, and Spring does a lot of its job through the Proxy design pattern. That means, for example, that if you annotate a Spring service with @Transactional, Spring needs to extend the class, so each method call can be intercepted and wrapped in a transaction.

In order to make that work with Kotlin, the Spring team defined an "all-open" plugin which opens Spring-managed beans for extension. From a user point of view, it's easy. You just add the plugin and code as usual. But the fact they had to do it makes me question whether "static binding by default" (making the classes final) was a good idea in the first place.

So Spring definitely likes working with Kotlin, but will they favor it in the future? I doubt that. Spring also has excellent support for Groovy, but even though that's also a language offered in the Spring Initializr (like Kotlin), it certainly hasn't replaced Java as the primary language for Spring apps.

I have some of this documented in my book, if you're interested, but just look at the web pages for Kotlin and Spring and you'll see these issues discussed in some detail. That's also a good example of how to sell Kotlin to Java developers, because the Spring people are doing that in their Kotlin API.
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!