Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin for fullstack web/apps development

Toan Tran
December 18, 2020

Kotlin for fullstack web/apps development

This talk covers the idea of having Kotlin to support in building multiple-component applications. With Kotlin's help, your Backend, Frontend, and Mobile all written in the same language, shares the same business model and domain objects, re-used the business rules and validations.
The talk also comes up with a sample code demonstration to understand how this could be realized.

Toan Tran

December 18, 2020
Tweet

More Decks by Toan Tran

Other Decks in Programming

Transcript

  1. Kotlin for fullstack web/apps development 1. What is Kotlin? (2

    mins ) 2. Why Kotlin? (5 mins ) 3. Kotlin multiple platform to power us (10 mins ) 4. Deep-dive into code to understand KMP (15 mins ) 5. Key-takeaways. (3 mins )
  2. Kotlin evolution v1.0: stable release v1.1: coroutines (experimental ) v1.2:

    Kotlin multiple platforms/Kotlin native (experimental) v1.3: coroutine (stable ) v1.4: Performance improvement
  3. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Why Kotlin?
  4. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Why Kotlin?
  5. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Why Kotlin?
  6. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Extension functions Why Kotlin?
  7. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Template expressions Extension functions Why Kotlin?
  8. class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?)

    { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Template expressions Extension functions Property access syntax for getters and setters Why Kotlin?
  9. How Kotlin Multiple Platform could help? 1. JVM Code 2.

    JS Code 3. Native Code 4. Common Kotlin
  10. KMP - Common Kotlin 1. The language, core libs, basic

    tools to serve all the platform. 2. Rely on daily-task support tools like Http, serialization, and managing coroutines.
  11. Key takeaways 1. Production ready? yes! (KotlinConf 2019: Kotlin in

    Space by Maxim Mazin) 2. Not everything can be shared a. To share: Data, View Model, Validations, Utils, View Model, RPC, Common Libs b. Not to share: UI, Data storage
  12. Key takeaways 3. Where to start? with sample a. Mobile

    KMP: Kotlin Conf app b. JS/JVM: [email protected]:kotlin-hands-on/jvm-js-fullstack.git c. Another one: [email protected]:Kotlin/kotlin-full-stack-application-demo.git 4. Start with step-by-step guide: here