O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building Spring Boot Apps with Kotlin

Video Description

Interest in the Kotlin programming language has been soaring. Kotlin’s effortless syntax and embrace of multiple programming styles are now fully supported in Spring Boot! In the video course Kotlin with Spring, seasoned IT trainer Matt Greencroft builds on your Java and Spring knowledge as you level up with Kotlin. This all-encompassing interactive journey gets you coding as you learn with lots of practical exercises and a cool hands-on real world case study: a theater booking system! You’ll be amazed at how much more productive you are when you combine the power of Spring with the flexibility and robustness of Kotlin!


about the subject

Kotlin is a modern programming language for the JVM developed by Jetbrains, the makers of the IntelliJ IDE. Besides Java, Kotlin is the only officially supported language for Android development. Fully interoperable with Java, Kotlin boasts a number of enhancements Java just doesn’t have. Say goodbye to repetitive boilerplate and null pointer exceptions and write code that’s expressive, understandable, and safe! What’s more, Kotlin allows for immutable and non-nullable variables, and you’ll be writing less code with fewer classes. Compared to other JVM languages, Kotlin is an easy transition for Java developers. And a smart one!


about the video

Building Spring Boot Applications with the Kotlin Programming Language teaches you to write clean, concise, easily maintainable Kotlin code using Spring Boot. Watch and learn as Kotlin expert Matt Greencroft explains Kotlin syntax and its automatic benefits. You’ll explore Kotlin features such as immutable variables, null-safety operators, data classes, templates, and top level functions. Then, you’ll discover the design approaches that make the most of the Spring and Kotlin combination, including using Spring Boot’s Hibernate framework and the Thymeleaf template engine.
You’ll dive into functional programming and reflection, and you’ll reinforce your learning with lots of helpful examples. Throughout the course, you’ll incorporate your new skills by building a real world theater booking system! With this value-rich visual learning experience, you’ll be more productive and—happier!—as you confidently create amazing, robust applications with Kotlin!

Inside:
  • Functional programming with collections
  • Creating immutable and non-nullable variables
  • How Kotlin helps you avoid null pointer exceptions
  • Exception handling in Kotlin, including custom exceptions
  • Using Spring Boot with Kotlin, including Hibernate and Thymeleaf
  • Converting existing Java apps to Kotlin
Perfect for Java programmers with some experience with Spring Boot. No Kotlin experience is required.

Matt Greencroft has been working as a professional IT trainer since 2013. His specialties are JavaEE, Android, Hadoop and NoSQL. Previously, he developed applications and websites for his clients in the business and finance sectors, many of which he still maintains.

Table of Contents

  1. INTRODUCTION
    1. Introduction, and install Hadoop on your desktop! 00:01:45
    2. What is Kotlin? 00:05:46
    3. Installing IntelliJ 00:03:12
    4. Configuring IntelliJ 00:07:07
  2. WORKING WITH STRINGS
    1. Creating a new project in Kotlin 00:05:45
    2. Variable declaration syntax 00:04:32
    3. Inferring variable types and println 00:04:17
    4. Using String templates 00:04:40
    5. Multiple line strings 00:06:54
  3. OTHER VARIABLE TYPES
    1. Using the Double and determining class types 00:04:25
    2. The Int data type 00:02:11
    3. Other data types 00:06:18
    4. Casting in Java 00:05:00
    5. Casting in Kotlin 00:06:35
    6. Chapter review 00:01:18
  4. NULLABLE VARIABLES
    1. Creating variables that can contain a null value 00:04:43
    2. Methods that work with nullable parameters 00:02:19
    3. The null-safe and non-null asserted operators 00:04:16
    4. The nothing object type 00:07:25
  5. FUNCTIONS
    1. The function syntax and the Unit object 00:04:01
    2. Creating and calling top level functions 00:04:38
    3. Single expression functions 00:03:14
    4. Using named parameters when calling functions 00:05:40
    5. Other aspects of functions in Kotlin 00:06:46
  6. CLASSES
    1. Project structure and packages 00:02:05
    2. The class declaration and class level attributes 00:03:31
    3. Instantiating a class, and accessing the class attributes 00:02:14
    4. Creating a simple constructor 00:05:07
    5. Secondary constructors 00:05:21
    6. Alternative class design 00:05:03
    7. Overriding getters and setters 00:07:21
    8. Functions within a class 00:02:58
    9. Static functions 00:03:29
    10. Data classes 00:07:32
  7. PRACTICAL EXERCISE 1
    1. Explaining the challenge 00:04:33
    2. Solution walkthrough 00:09:51
  8. THE IF EXPRESSION AND OBJECT EQUALITY
    1. The If keyword as an expression 00:04:49
    2. Using if to do a null-safe check 00:07:07
    3. The let function 00:09:37
    4. Object equality and the when expression 00:05:32
  9. RANGES AND LOOPING
    1. The While loop 00:01:25
    2. Using for to loop through a collection 00:05:26
    3. Destructuring with a for loop 00:03:01
    4. Looping with the Range object 00:06:14
  10. COLLECTIONS
    1. Mutable collections with immutable variables 00:01:29
    2. Immutable lists 00:04:00
    3. Mutable lists 00:01:30
    4. Maps and sets 00:01:45
    5. Working with Arrays 00:04:16
  11. PRACTICAL EXERCISE 2
    1. Explaining the challenge 00:07:10
    2. Solution walkthrough 00:08:46
  12. EXCEPTIONS AND TRY CATCH BLOCKS
    1. Exceptions are unchecked 00:04:55
    2. Throwing exceptions 00:04:45
    3. Try as an expression 00:02:24
    4. Use as an expression (try with resources) 00:02:58
  13. TESTING
    1. Using Junit with Kotlin 00:05:02
    2. The Kotlin test assertions 00:05:09
    3. Testing for exceptions 00:04:20
  14. INTERFACES AND EXTENDING CLASSES
    1. Creating and implementing Interfaces 00:04:49
    2. Class inheritance 00:05:12
    3. Creating custom exceptions 00:02:36
    4. Extension functions 00:04:38
  15. JAVA INTEROPERABILITY
    1. Instantiating classes and providing values to non-nullable variables 00:06:09
    2. Using data classes 00:01:21
    3. Using immutable lists 00:02:18
    4. Exception handling 00:03:18
    5. Using static functions 00:03:18
    6. Importing a Kotlin jar into a Java project 00:04:12
  16. GETTING STARTED WITH SPRING BOOT
    1. Creating a project with the Spring Initializer 00:04:30
    2. A hello world controller 00:03:34
    3. Auto restarting an application 00:04:18
    4. Overview of the case study we’ll be working on 00:01:42
    5. Creating views and backing beans 00:05:16
    6. Connecting views to controller functions 00:02:11
    7. Adding services 00:04:13
    8. Posting data to a controller 00:05:04
    9. Dependency injection 00:06:38
    10. Revisiting backing beans 00:03:33
  17. FUNCTIONAL PROGRAMMING
    1. Functional programming overview 00:04:57
    2. Methods that take function parameters - the Java way 00:05:17
    3. Methods that take function parameters - the Kotlin way 00:05:19
    4. Functional programming with lists 00:06:49
    5. Filter and flatmap 00:03:46
    6. Reduce and Fold 00:06:34
    7. Working with Maps 00:03:14
  18. GETTING STARTED WITH HIBERNATE
    1. Adding the Hibernate dependencies 00:05:01
    2. The challenge of creating entities 00:07:40
    3. Persisting data to a database 00:05:11
  19. PRACTICAL EXERCISE 3
    1. Step 1 - explaining the challenge 00:04:07
    2. Solution Walkthrough 00:02:33
    3. Mappings between entities 00:07:34
    4. Upgrading the view 00:11:25
    5. Step 2 - explaining the challenge 00:02:26
    6. Solution walkthrough 00:09:04
    7. Step 3 - explaining the challenge 00:03:21
    8. Solution walkthrough 00:04:21
  20. REFLECTION
    1. The concept of reflection 00:07:21
    2. Inspecting properties and functions 00:03:48
    3. A practical use for reflection 00:09:43
    4. Thank you and goodbye 00:00:39