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

Moshi's Kotlin CodeGen

BrianPlummer
February 13, 2019
110

Moshi's Kotlin CodeGen

Learn how to leverage Moshi’s Kotlin codegen so your data model can be immutable and quickly parsed reflection free. I’ll discuss why this is important to us as developers, integration details, and how Moshi implemented this feature!

BrianPlummer

February 13, 2019
Tweet

Transcript

  1. Mike’s first month at the New York Times Application startup

    time was horrible. He started digging and found some issues.
  2. One big culprit was parsing a configuration file that we

    needed for Application start up Roughly 700ms wasted!
  3. Data classes give us most of what we needed •Unfun

    methods •Copy methods •Immutability
  4. Data classes give us most of what we needed •Unfun

    methods •Copy methods •Immutability •Reflection free parsing
  5. @JsonClass(generateAdapter = true) data class Book ( val title: String?,

    val authors: List<Author>, val isbn: String )