Skip to content

Instantly share code, notes, and snippets.

@MatMoore
Last active November 21, 2022 10:42
Show Gist options
  • Save MatMoore/e4e7d0a7ccb51a8ea0debb0d3609ef5d to your computer and use it in GitHub Desktop.
Save MatMoore/e4e7d0a7ccb51a8ea0debb0d3609ef5d to your computer and use it in GitHub Desktop.
Kotlin learning pathway

Language fluency

Interactive courses

Projects

Other resources

Deep dives

Learning path

flowchart TD
    DataTypes("Kotlin types and collections")
    Null("Null safety")
    Expressions("Control structures and expressions")
    Functions("Functions and lambdas")
    Preconditions("require, check, assert")
    FP("Functional programming")
    Java("Interacting with Java code")
    OOP("Classes, data classes")
    ValueClasses("Value classes (inline classes)")
    Types("Type aliases, enums, sealed classes")
    Generics("Generics and variance")
    Packaging("Packages and imports")
    Destructuring("Destructuring")
    Coroutines("Coroutines")
    Ktor("Ktor")
    Serialization("Serialization")
    Test("kotlin.test")
    Text("kotlin.text")
    Time("kotlin.time")
    Reflection("Reflection API")
    JCA("Java Cryptography Architecture")
    IO("kotlin.io")
    DataTypes --> Null
    Null --> Expressions
    Expressions --> Functions
    Functions --> Preconditions
    Preconditions --> Destructuring
    Destructuring --> FP
    Destructuring --> OOP
    OOP --> Types
    OOP --> Generics
    FP --> Packaging
    Types --> Packaging
    Generics --> Packaging
    Packaging --> Test
    Test --> Text
    Test --> IO
    IO --> Time
    Time --> Java
    Time --> Serialization
    Time --> Coroutines
    Coroutines --> Ktor
    Java --> Reflection
    Java --> JCA
    OOP --> ValueClasses
    style DataTypes fill:#9f9,stroke:#333
    style Functions fill:#9f9,stroke:#333
    style Preconditions fill:#9f9,stroke:#333
    style Null fill:#9f9,stroke:#333
    style Expressions fill:#9f9,stroke:#333
    style IO fill:#9f9,stroke:#333
    style Test fill:#9f9,stroke:#333
    style OOP fill:#9f9,stroke:#333
    style ValueClasses fill:#9f9,stroke:#333
    style Couroutines fill:#9f9,stroke:#333
    style Types fill:#9f9,stroke:#333

Spring in Kotlin

Spring cheatsheet: https://dzone.com/refcardz/spring-configuration

Setting up a project

Topics

Learning path

flowchart TD
  Beans("Bean definition DSL")
  Configuration("Configuration")
  Injection("Dependency injection via annotations")
  SpringMVC("Spring MVC")
  JPA("SpringData, JPA")
  Flyway("Flyway migrations")
  Transactions("Transactions")
  Sagas("Saga pattern in Spring")
  Beans --> Injection
  Injection --> Configuration
  Configuration --> SpringMVC
  SpringMVC --> JPA
  JPA --> Flyway
  JPA --> Transactions
  Transactions --> Sagas
  style Flyway fill:#9f9,stroke:#333
  click Transactions href "https://victorrentea.teachable.com/p/transactions-in-spring" "Transactions course"

Dev tools and debugging tips

Build and run CLI apps with gradle

See https://www.baeldung.com/kotlin/gradle-executable-jar

tasks {
    val fatJar = register<Jar>("fatJar") {
        dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources")) // We need this for Gradle optimization to work
        archiveClassifier.set("standalone") // Naming the jar
        duplicatesStrategy = DuplicatesStrategy.EXCLUDE
        manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration
        val sourcesMain = sourceSets.main.get()
        val contents = configurations.runtimeClasspath.get()
            .map { if (it.isDirectory) it else zipTree(it) } +
                sourcesMain.output
        from(contents)
    }
    build {
        dependsOn(fatJar) // Trigger fat jar creation during build
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment