Spring Boot & Kotlin: Pain or Gain? by Urs Peter @ Spring I/O 2024

Sdílet
Vložit
  • čas přidán 22. 08. 2024
  • Spring I/O 2024 - 30-31 May, Barcelona
    Slides: 2024.springio....
    Spring Boot has been the No. 1 framework for Java developers ever since. With its first-class support for Kotlin, a new frontier of possibilities opens up. Can Kotlin propel Spring Boot to new heights of efficiency and simplicity beyond what Java offers?
    Join me on an enlightening journey as we explore the potential advantages and pitfalls of integrating Kotlin into the Spring Boot ecosystem. We’ll begin by dissecting Spring Boot’s support for Kotlin features such as extensions, data classes, nullability, and more. Can they live up to their promise of improved code safety, conciseness, and readability compared to their Java counterparts?
    In the second part, we will venture into more advanced territory by investigating how reactive Spring Boot Webflux - highly efficient yet notorious for its complexity and steep learning curve - might be simplified using Coroutines, Kotlin’s built-in asynchronous language feature. Are the potential benefits worth the hassle of learning Coroutines? And yes, we’ll take a look at the role Virtual Threads can play in that regard!
    Finally, we’ll dive into the practical realm, transforming a Spring Boot application written in Java to Kotlin on the spot using live coding to explore tooling support and possible conversion strategies, accompanied by intriguing stories from real-world use cases.
    At the end of the journey, you have gained a nuanced understanding of the benefits and drawbacks Spring Boot offers when used with Kotlin compared to Java. Will the pain of adoption be worth the potential gain? Let’s find out together!

Komentáře • 18

  • @matthewmoore5934
    @matthewmoore5934 Před 9 dny

    Great video! Under the heading of "more functional" I do wish Urs had mentioned the fact that many more things are expressions in Kotlin than in Java. For example, try, if, and when among others all return a value. This eliminates the all-too-common and error prone pattern of creating a local variable initialized to null upstream of a block, and then assigning to it inside a conditionally-executed block. Instead, the if/else or try/catch itself returns a value. This contributes to concision, safety, and readability.

  • @SureshG
    @SureshG Před 2 měsíci +7

    It's not correct to say there is no parallelism in virtual thread. There is virtualThreadPerTaskExecutor and structured concurrency support (which is in preview, but haven't changed much) to execute things concurrently. On JVM, you forgot about other major advantages of using virtual threads like better debugging , stack trace, profiling etc.

  • @kokosensei5231
    @kokosensei5231 Před 2 měsíci +3

    Thank you for sharing!

  • @hackneymarshes
    @hackneymarshes Před 25 dny

    Truly excellent talk highlighting the many benefits of Kotlin. Thanks for also going into WebFlux and coroutines towards the end.

  • @bofu9662
    @bofu9662 Před 2 měsíci +2

    Nice video, Happy Kotliner

  • @ArtemKhodos
    @ArtemKhodos Před 2 měsíci +3

    Gain! Unfortunatelly Kotlin for backend doesn't get enough

  • @mohamadsharifi2353
    @mohamadsharifi2353 Před 2 měsíci +6

    15:51 using kotlin data classes as JPA entites is not a good idea.

  • @thilankaliyanaarachchi984
    @thilankaliyanaarachchi984 Před měsícem

    14:57 Java records now supports derived records (JEP 468)

  • @BelarusianInUk
    @BelarusianInUk Před měsícem +1

    Kotlins come and go. Java stays forever 😊

  • @thilankaliyanaarachchi984
    @thilankaliyanaarachchi984 Před měsícem

    Is there any way to call suspend function from a non suspend function? Does it even make sense?

  • @anoozg9565
    @anoozg9565 Před 2 měsíci

    Null to optional 😂 good point that’s a total anti pattern for optional

  • @bobliu-bt1uw
    @bobliu-bt1uw Před 2 měsíci +2

    Kotlin's syntax and concepts are similar with C#, which one comes first😃

    • @SureshG
      @SureshG Před 2 měsíci +5

      Kotlin is much more ergonomic and concise. Over the period of time, C# has become a kitchen sink language.

  • @reperionkim8187
    @reperionkim8187 Před 2 měsíci +1

    Someone said that Kotlin is valuable just because it doesn't use semicolons.

  • @TheDrezir
    @TheDrezir Před měsícem

    I dont understand the trend to make comparison amogn these two languages. Man can make safe and readable code in java & kotlin. All features are now available in both languages, it only differs in what it is called and the usage (for example extension functions you replace with util classes or use bytecode maven plugin for support it dirrectly). This comparision sessions are only for guys liking the smell of their farts (south park if you know :D)

  • @chauchau0825
    @chauchau0825 Před 2 měsíci +1

    Scala cult, Groovy cult, amd now Kotlin cult

    • @mrkostya008
      @mrkostya008 Před 2 měsíci +1

      and yet Google ditched the Java cult