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

Ktor - Foundations

Ktor - Foundations

Ktor - Foundations
Workshop on Ktor
Class 1.
https://github.com/jggomez/Ktor_Workskop

Juan Guillermo Gómez Torres

September 08, 2020
Tweet

More Decks by Juan Guillermo Gómez Torres

Other Decks in Programming

Transcript

  1. Consejos ➢ Mira todo desde lo positivo, este workshop es

    con amor. ➢ Comparte en redes fotos o mensajes positivos sobre el Workshop en twitter o facebook y nombra a @devhackcali @jggomezt. ➢ Respeto a los compañeros y mentores. ➢ Cerrar los micrófonos. ➢ Apagar cámaras. ➢ Puedes realizar las preguntas que sean sobre el tema en cuestión, hacerlas en el chat de Q&A. ➢ Si tienes un feedback constructivo escríbenos a [email protected]. ➢ Disfruta y sé feliz !!!
  2. Juan Guillermo Gómez ➢ Co-Leader y Co-Founder of GDG Cali.

    ➢ Tech Lead at WordBox & Founder at DevHack ➢ Consultant and advisor on software architecture, cloud computing and software development. ➢ Experience in several languages and platforms. (C, C#, Java, NodeJS, android, GCP, Firebase). ➢ Google Developer Expert (GDE) in Firebase & GCP ➢ BS in System Engineering and a MS in Software Engineering. ➢ @jggomezt
  3. Kotlin ➢ Open-sourced 2012. ➢ Developed by JetBrains. ➢ Version

    1.0 in 2016. ➢ Modern programming language ➢ Object Oriented. ➢ Statically typed. ➢ Less code with fewer bugs. ➢ Lambdas and properties. ➢ Nullable and non-nullable data type. ➢ Very concise. ➢ Remove a lot of boilerplate from code. ➢ Readability. ➢ Functional constructs. ➢ Object Oriented. ➢ Use Java Libraries. ➢ Immutability.
  4. Kotlin ➢ Official for Android Apps 2017. ➢ IntelliJ and

    Android Studio 3.0+. ➢ Server side. ➢ Use Java Libraries.
  5. Kotlin vs java Features Java Kotlin Fully OOP Not pure

    OOP Fully OOP Null safety No Yes Checked Exception Yes No Invariant Array No Yes Smart Casts No Yes Lambda Expression No Yes Immutability No Yes
  6. Nullable types and Non-Null Types ➢ One of the most

    common pitfalls in many programming languages, including Java ➢ NullPointerException ➢ Eliminating the danger of null references from code ➢ The billion dollar mistake ➢ A regular variable of type String can not hold null. ➢ We can declare a variable as nullable string, written String? ➢ Safe Calls. b?.length ➢ Elvis operator => b?.length ?: -1
  7. ➢ Ktor is a framework for building asynchronous servers and

    clients in connected systems using the powerful Kotlin. ➢ Creating web applications ➢ Creating web services ➢ Connecting to services and applications.
  8. configured server engine modules features routing A Ktor Server Application

    is a custom program listening to one or more ports using a configured server engine, composed by modules with the application logic, that install features, like routing, sessions, compression, etc. to handle HTTP/S 1.x/2.x and WebSocket requests.
  9. Challenge Crea un programa para una tienda de ropa que

    permita: ◦ Pedir datos del cliente (nit, nombres, fecha de nacimiento, genero, email y número de contacto) ◦ Enviar un email de registro diciéndole que es un cliente de tipo (Oro, Plata o Bronce) dependiendo lo siguiente: ▪ Si es hombre o mujer entre los 20 y 30 es Bronce ▪ Si es mujer entre entre los 30 y 50 es Plata ▪ Si es hombre entre los 30 y 40 sigue siendo Bronce. ▪ Si es hombre entre los 40 y 50 es Plata. ▪ Si es hombre o mujer mayor de los 50 es cliente Oro. ◦ El sistema debe enviar el correo y mostrar en pantalla, el tipo de cliente que es.