
A complete hands on approach to learn the Kotlin programming language and build Restful APIs using Kotlin SpringBoot
Description
Kotlin is the Modern, concise and safe programming language and is one of the popular JVM language in this day and age.It’s also interoperable with Java and other languages, and provides many ways to reuse code between multiple platforms for productive programming.
This course will focus on using Kotlin for Server-Side Development using SpringBoot framework. This is a pure hands-on oriented course which covers these two topics:
- Covers Kotlin Fundamentals thats necessary for Java Developers
- Build RestFul APIs using SpringBoot and Kotlin
- This section covers the course objectives and the prerequisites that are needed to make the most out of this course.
- In this section, I will introduce you to Kotlin Programming Language and why its a powerful language for enterprise development.
- Introduction to Kotlin
- How Kotlin Works with the JVM?
- In this section, we will explore the fundamentals of Kotlin.
- val & var variables in Kotlin
- Basic Types - Int, Long, Double, String
- Conditionals - If and when block
- Ranges , Loops
- while & do-While
- break, labels and return
- In this section, we will learn about functions in Kotlin and different ways of declaring and using them
- Defining and Invoking Functions
- Default Value Parameters & Named Arguments
- Top-Level Functions and Top-level Properties
- In this section, we will learn about classes, inheritance and interfaces in detail.
- Introduction to class - Creating a class and objects
- Primary Constructors
- Secondary Constructors
- initializer code using init block
- Data Classes
- Custom Getters and Setters
- Inheritance - Extending Classes
- Inheritance - Override Functions, Variables
- object keyword for creating instance of the class
- companion object Keyword
- Interfaces
- Interfaces - Handling Conflicting Functions
- Interfaces - Defining and Overrding Variables
- Visibility Modifiers
- Type Checking, Casting and Smart Cast
- Enum class
- In this section, we will learn about handling nulls in Kotlin
- Nullable & Non-Nullable types in Kotlin
- Safe Call(?) , Elvis Operator(?
& Non Null Assertion(!!) to deal with Null Values
- Invoking or assigning a Nullable Type to a Non-Nullable Type
- In this section, I will introduce you to collections, arrays and lambda expressions in Kotlin
- Introduction to Collections
- Introduction to Lamda Expressions
- Lambdas and Higher Order Functions
- Filter Operations on Kotlin Collections
- Map Operations on Kotlin Collections
- FlatMap Operations in Collections
- Working With HashMaps
- Lazy Evaluation of Collections using Sequences
- Nullability in Collections
- In this section, I will cover the exceptions in kotlin and the techniques to handle them.
- Handling Exceptions using try-catch
- In this section, I will introduce you all to scope functions in Kotlin and its usage.
- Introduction to Scope Functions
- apply & also Scope Function
- let Scope Function
- with & run Scope Function
- In this section, I will explain the overview of the app we are going to build and build a very simple API.
- Overview of the app & Project Setup
- Build a Simple Endpoint - Greeting Controller
- Constructor Injection in Spring
- Setting up different profiles in Spring Boot
- Set up Logging in Kotlin
- In this section, I will code and explain about the techniques to write different types of test cases using spring boot and Kotlin.
- Introduction to Automated Tests & Setting up JUnit5
- Integration Test for Controller
- Unit Test for Controller - Using the Mockk Mocking library
- In this section, we will build the Course Catalog Service to manage the Courses
- Set up the Course Entity & CourseDTO
- Create CourseRepository & Configure JPA in application.yml file
- Build the POST Endpoint for adding new Course I
- ntegration test for the POST endpoint using JUnit5
- Build the Get Endpoint to retrieve all Courses
- Integration test for the GET endpoint to retrieve all the courses
- Build the Update Endpoint to update a Course
- Integration test for the PUT endpoint using JUnit5
- Build the DELETE endpoint to delete a Course
- In this section, we will code and learn about how to write unit tests for the controller
- Setting up the Unit Test for the CourseController
- Unit test for the Post Endpoint in CourseController
- Unit test for the GET Endpoint in CourseController
- Unit test for the PUT Endpoint in CourseController
- Unit test for the DELETE Endpoint in CourseController
- In this section, we will code and learn the different techniques to apply bean validations and handle exceptions using the ControllerAdvice Pattern
- Name and Category as Mandatory using @NotBlank Annotation
- Implement Custom Error Handling using ControllerAdvice pattern
- Handle Global RuntimeException using ControllerAdvice Pattern
- In this lecture, we will learn about the techniques to write custom JPA queries and the techniques to test the DB layer using the DataJpaTest
- Retrieve Courses By Name using JPA Query Creation Function
- Retrieve Courses By Name using Native SQL query
- Testing Mutliple sets of Data using @Parameterized test
- In this section, we will code and learn about the usage of RequestParam in the controller endpoint.
- Use existing GET endpoint to retrieve Courses by Name
- Write Integration test to retrieve course by Name
- In this section, I will explain the technique to express the relationships in JPA using Entity and Data classes in Kotlin
- Adding Instructor Entity in to the Course Catalog Service
- Adding the relationship in the Entity Class
- Instructor Controller to Manage Instructor Data
- Update CourseService to validate Instructor Data
- Fix the CourseController Integration Tests
- Fix the CourseController Unit Tests
- In this section, we will code and learn to integrate the postgres DB in to the course catalog service.
- Setting up the Postgres DB and App to interact with Postgres
- Test the app with Postgres DB
- In this section, we will code and learn to integrate the testcontainers to run integration test.
- Setting Up TestContainers for the Integration Test
- Configure @DataJpaTest with TestContainers
- In this section, we will code and learn about the interoperability between Java and Kotlin.
- Invoking Kotlin Code from Java Class
- Invoking Java Code from Kotlin
- Useful JVM annotations in Kotlin
Who this course is for:
- Developers who are interested in learning Kotlin Programming language
- Developers who are interested in building applications using Kotlin and SpringBoot
- Java developers who would like to learn Kotlin Programming Language