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

Kotlin on the Cloud

Kotlin on the Cloud

Slides for my 'Kotlin on the Cloud' talk at the Google Developer Group Lisboa's Kotlin Night.

João Carvalho

October 12, 2017
Tweet

More Decks by João Carvalho

Other Decks in Programming

Transcript

  1. About me • Senior Developer / Team Lead @ Talkdesk

    • Backend Developer • IST Alumni (Student & Developer) • PT.JUG Speaker • Follow me on Twitter @johnkarva
  2. “Cloud-native is an approach to building and running applications that

    fully exploits the advantages of the cloud computing delivery model. Cloud-native is about how applications are created and deployed, not where.”
  3. 12 Factor App 1. Single codebase, multiple deploys 2. Explicit

    Dependencies 3. Store Config in Environment 4. Backing Services as resources 5. Separate Build, Release, Execution 6. Standalone (Volatile) Process 7. Port Binding 8. Multiple Process Types 9. Disposability 10. Environment Parity 11. Logs as Event Streams 12. One-off Admin Tasks
  4. public class Person { private String name; private int age;

    public Person(String name, int age) { this.name = name; this.age = age; } (...) }
  5. public String getName() { return name; } public void setName(String

    name) { this.name = name; } @Override public boolean equals(Object o) { (Stuff generated by your IDE) } @Override public int hashCode() { int result = name.hashCode(); result = 31 * result + age; return result; }
  6. And much more... • No Semicolons! • Lambda Expressions and

    Inline Functions • Type inference • Named Arguments • Default Values • String Interpolation • Ranges • Immutable Collections (Kind of) • Collection helpers • Infix Functions • DSL Support
  7. @RestController @SpringBootApplication public class DemoApplication { public static void main(String[]

    args) { SpringApplication.run(DemoApplication.class, args); } @GetMapping("/hello") public String hello() { return "Hello World!"; } }