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

Designing robust APIs in Kotlin

Designing robust APIs in Kotlin

Designing robust APIs in Kotlin.

D4df9c152982182ce1125e49fe83527c?s=128

Jaewoong

March 17, 2022
Tweet

More Decks by Jaewoong

Other Decks in Technology

Transcript

  1. Designing robust APIs in Kotlin Jaewoong Eum

  2. About me github.com/skydoves

  3. How to build solid APIs? 🤔

  4. API design API surface

  5. API design Client Client Client Client API surface

  6. API design Client Client Client Client API surface

  7. API design Client Client Client Client API surface

  8. API design Client Client Client Client API surface

  9. API design Minimal API surface area

  10. API design Client Client Client Client Minimal API surface area

  11. API design Client Client Client Client Minimal API surface area

  12. API design Client Client Client Client Minimal API surface area

  13. API visibility private internal importance protected public Visibility modifiers

  14. API visibility public importance Client Client Client private internal protected

    Visibility modifiers
  15. API visibility Property

  16. API visibility Property setter getter

  17. API visibility Property // penguin setter getter

  18. API visibility Property setter getter Cannot assign to 'data': the

    setter is private in 'MyViewModel`
  19. API visibility Extension

  20. API visibility Extension

  21. API visibility Extension Unresolved reference

  22. API visibility Extension

  23. API visibility Extension 😵

  24. API visibility @JvmSynthetic

  25. API visibility @JvmSynthetic

  26. API visibility @JvmSynthetic Unresolved reference

  27. API visibility @JvmSynthetic

  28. API visibility @PublishedApi

  29. API visibility @PublishedApi

  30. API visibility @PublishedApi

  31. API visibility @PublishedApi

  32. API visibility @PublishedApi

  33. API visibility KEEP

  34. API visibility Explicit API mode

  35. API visibility Explicit API mode

  36. API visibility Explicit API mode (strict)

  37. API visibility Explicit API mode (strict)

  38. API visibility Explicit API mode (strict)

  39. API visibility Explicit API mode (strict)

  40. API visibility Explicit API mode (warning)

  41. API visibility Explicit API mode (warning)

  42. API visibility Binary compatibility validator

  43. API visibility Binary compatibility validator build.gradle module.gradle On terminal

  44. API visibility Binary compatibility validator module.api

  45. API visibility Binary compatibility validator

  46. API visibility metalava

  47. API visibility metalava

  48. Client Client Client Client API maintenance API surface

  49. Client Client Client Client API maintenance API surface

  50. Client Client Client Client API maintenance API surface

  51. Client Client Client Client API maintenance API surface

  52. API maintenance API lifecycle Created Deprecated (warning) Removed Deprecated (error)

  53. API maintenance API lifecycle Created Deprecated (warning) Removed Deprecated (error)

  54. API maintenance @Deprecated (warning)

  55. API maintenance @Deprecated (warning)

  56. API maintenance @Deprecated (warning)

  57. API maintenance @Deprecated (warning)

  58. API maintenance @Deprecated (warning) Show Context Actions

  59. API maintenance @Deprecated (error)

  60. API maintenance API lifecycle Created Deprecated (warning) Removed Deprecated (error)

    v4.2.10 v4.2.20 v4.2.21 v4.3.0
  61. API maintenance API lifecycle Created Deprecated (warning) Removed Deprecated (error)

    v4.2.10 v4.2.20 v4.2.21 v4.3.0
  62. API maintenance API lifecycle Created Deprecated (warning) Removed Deprecated (error)

    v4.2.10 v4.2.20 v4.2.21 v4.3.0 Client
  63. API maintenance API lifecycle Client Client Created Deprecated (warning) Removed

    Deprecated (error) v4.2.10 v4.2.20 v4.2.21 v4.3.0
  64. API maintenance API lifecycle Client Client Created Deprecated (warning) Removed

    Deprecated (error) v4.2.10 v4.2.20 v4.2.21 v4.3.0
  65. API maintenance Deprecations

  66. Client Client Client Client API maintenance @RequiresOptIn

  67. Client Client Client Client API maintenance @RequiresOptIn Experimental

  68. Client Client Client Client API maintenance @RequiresOptIn @RequiresOptIn

  69. API maintenance @RequiresOptIn

  70. API maintenance @RequiresOptIn

  71. API maintenance @RequiresOptIn

  72. API maintenance @RequiresOptIn

  73. API maintenance @RequiresOptIn

  74. API maintenance @RequiresOptIn

  75. API maintenance @RequiresOptIn Core module UI module

  76. API maintenance @RequiresOptIn Core module UI module Client Client

  77. API maintenance @RequiresOptIn Core module UI module Client Client

  78. API maintenance @RequiresOptIn Core module UI module Client Client

  79. API maintenance @RequiresOptIn Core module UI module Client Client

  80. API maintenance @RequiresOptIn Core module UI module Client Client

  81. API maintenance @RequiresOptIn

  82. API maintenance @RequiresOptIn

  83. References • Kotlin Docs ◦ https://kotlinlang.org/docs/home.html • Mastering API Visibility

    in Kotlin (Márton Braun) ◦ https://zsmb.co/mastering-api-visibility-in-kotlin/ • KEEP - Kotlin Evolution and Enhancement Process ◦ https://github.com/Kotlin/KEEP • Binary Compatibility Validator ◦ https://github.com/Kotlin/binary-compatibility-validator • Effective Kotlin ◦ https://leanpub.com/effectivekotlin • Balloon ◦ https://github.com/skydoves/Balloon • Stream Chat Android ◦ https://github.com/GetStream/stream-chat-android
  84. Reach out skydoves2@gmail.com https://github.com/skydoves https://twitter.com/github_skydoves https://medium.com/@skydoves

  85. Thank You!