Curso Kotlin

  • Development

Curso Kotlin

44h
Visão Geral

Este Curso Kotlin, fornece habilidades sobre recursos orientados a objetos na linguagem de programação Kotlin e seu design e práticas.

 

Objetivo

Após concluir este Curso Kotlin, você será capaz de:

  • Codifique aplicativos Kotlin usando estruturas, bibliotecas e ferramentas Java existentes.
  • Escreva um aplicativo de back-end com código padrão mínimo.
  • Compile o código Kotlin para bytecode JVM, JavaScript e Kotlin Native.
  • Depure e otimize o código Kotlin.
  • Teste e implante um aplicativo Kotlin.
Publico Alvo
  • Esta classe Kotlin é adequada para desenvolvedores
Pre-Requisitos
  • Experiência em programação Java.
Materiais
Inglês/Português/Lab Pratico
Conteúdo Programatico

Kotlin: What and Why?

  • A taste of Kotlin
  • Kotlin’s primary traits
    1. Target platforms: server-side, Android, anywhere Java runs
    2. Statically typed
    3. Functional and object-oriented
    4. Free and open source
  • Kotlin applications
    1. Kotlin on Android
  • The philosophy of Kotlin
    1. Pragmatic
    2. Concise
    3. Safe
    4. Interoperable
  • Using the Kotlin tools
    1. Compiling Kotlin code
    2. Plug-in for IntelliJ IDEA and Android Studio
    3. Interactive shell
    4. Eclipse plug-in
    5. Online playground
    6. Java-to-Kotlin converter

Kotlin Basics

  • Basic elements: functions and variables
    1. Hello, world!
    2. Functions
    3. Variables
    4. Easier string formatting: string templates
  • Classes and properties
    1. Properties
    2. Custom accessors
    3. Kotlin source code layout: directories and packages
  • Representing and handling choices: enums and “when”
    1. Declaring enum classes
    2. Using “when” to deal with enum classes
    3. Using “when” with arbitrary objects
    4. Using “when” without an argument
    5. Smart casts: combining type checks and casts
    6. Refactoring: replacing “if” with “when”
    7. Blocks as branches of “if” and “when”
  • Iterating over things: “while” and “for” loops
    1. The “while” loop
    2. Iterating over numbers: ranges and progressions
    3. Iterating over maps
    4. Using “in” to check collection and range membership
  • Exceptions in Kotlin
    1. “try”, “catch”, and “finally”
    2. “try” as an expression

Defining and Calling Functions

  • Creating collections in Kotlin
  • Making functions easier to call
    1. Named arguments
    2. Default parameter values
    3. Getting rid of static utility classes:
    4. Top-level functions and properties
  • Extension Functions and Properties
    1. Extension functions and properties
    2. Imports and extension functions
    3. Calling extension functions from Java
    4. Utility functions as extensions
    5. No overriding for extension functions
    6. Extension properties
  • Working with collections: varargs, infix calls, and library support
    1. Extending the Java Collections API
    2. Varargs: functions that accept an arbitrary number of arguments
    3. Working with pairs:
    4. Infix calls and destructuring declarations
  • Working with strings and regular expressions
    1. Splitting strings
    2. Regular expressions and triple-quoted strings
    3. Multiline triple-quoted strings
  • Making your code tidy: local functions and extensions

Classes, Objects, and Interfaces

  • Defining class hierarchies
    1. Interfaces in Kotlin
    2. Open, final, and abstract modifiers: final by default
    3. Visibility modifiers: public by default
    4. Inner and nested classes: nested by default
    5. Sealed classes: defining restricted class hierarchies
  • Declaring a class with nontrivial constructors or properties
    1. Initializing classes: primary constructor and initializer blocks
    2. Secondary constructors:
    3. Implementing properties declared in interfaces
    4. Accessing a backing field from a getter or setter
    5. Changing accessor visibility
  • Compiler-generated methods: data classes and class delegation
    1. Universal object methods
    2. Data classes:
    3. Auto generated implementations of universal methods
    4. Class delegation: using the “by” keyword
  • The “object” keyword:
    1. declaring a class and creating an instance, combined
    2. Object declarations: singletons made easy
    3. Companion objects:
    4. a place for factory methods and static members
    5. Companion objects as regular objects
    6. Object expressions: anonymous inner classes rephrased

Programming With Lambdas

  • Lambda expressions and member references
    1. Introduction to lambdas: blocks of code as function parameters
    2. Lambdas and collections
    3. Syntax for lambda expressions
    4. Accessing variables in scope
    5. Member references
  • Functional APIs for collections
    1. Essentials: filter and map
    2. “all”, “any”, “count”, and “find”:
    3. applying a predicate to a collection
    4. groupBy: converting a list to a map of groups
    5. flatMap and flatten: processing elements in nested collections
  • Lazy collection operations: sequences
    1. Executing sequence operations:
    2. intermediate and terminal operations
    3. Creating sequences
  • Using Java functional interfaces
    1. Passing a lambda as a parameter to a Java method
    2. SAM constructors:
    3. explicit conversion of lambdas to functional interfaces
  • Lambdas with receivers: “with” and “apply”
    1. The “with” function
    2. The “apply” function

The Kotlin Type System

  • Nullability
    1. Nullable types
    2. The meaning of types
    3. Safe call operator: “?.”
    4. Elvis operator: “?:”
    5. Safe casts: “as?”
    6. Not-null assertions: “!!”
    7. The “let” function
    8. Late-initialized properties
    9. Extensions for nullable types
    10. Nullability of type parameters
    11. Nullability and Java
  • Primitive and other basic types
    1. Primitive types: Int, Boolean, and more
    2. Nullable primitive types: Int?, Boolean?, and more
    3. Number conversions
    4. “Any” and “Any?”: the root types
    5. The Unit type: Kotlin’s “void”
    6. The Nothing type: “This function never returns”
  • Collections and arrays
    1. Nullability and collections
    2. Read-only and mutable collections
    3. Kotlin collections and Java
    4. Collections as platform types
    5. Arrays of objects and primitive types

Operator Overloading and Conventions

  • Overloading arithmetic operators
    1. Overloading binary arithmetic operations
    2. Overloading compound assignment operators
    3. Overloading unary operators
  • Overloading comparison operators
    1. Equality operators: “equals”
    2. Ordering operators: compareTo
  • Conventions used for collections and ranges
    1. Accessing elements by index: “get” and “set”
    2. The “in” convention
    3. The “rangeTo” conventions
    4. The “iterator” convention for the “for” loop
  • Destructuring declarations and component functions
    1. Destructuring declarations and loops
  • Reusing property accessor logic: delegated properties
    1. Delegated properties: the basics
    2. Using delegated properties: lazy initialization and “by lazy()”
    3. Implementing delegated properties
    4. Delegated-property translation rules
    5. Storing property values in a map
    6. Delegated properties in frameworks

Higher-Order Functions

  • Declaring higher-order functions
    1. Function types
    2. Calling functions passed as arguments
    3. Using function types from Java
    4. Default and null values for parameters with function types
    5. Returning functions from functions
    6. Removing duplication through lambdas
    7. Inline functions: removing the overhead of lambdas
    8. How inlining works
    9. Restrictions on inline functions
  • Inlining collection operations
    1. Deciding when to declare functions as inline
    2. Using inlined lambdas for resource management
  • Control flow in higher-order functions
    1. Return statements in lambdas: return from an enclosing function
    2. Returning from lambdas: return with a label
    3. Anonymous functions: local returns by default

Generics

  • Generic type parameters
    1. Generic functions and properties
    2. Declaring generic classes
    3. Type parameter constraints
    4. Making type parameters non-null
  • Generics at runtime: erased and reified type parameters
    1. Generics at runtime: type checks and casts
    2. Declaring functions with reified type parameters
    3. Replacing class references with reified type parameters
    4. Restrictions on reified type parameters
  • Variance: generics and subtyping
    1. Why variance exists: passing an argument to a function
    2. Classes, types, and subtypes
    3. Covariance: preserved subtyping relation
    4. Contravariance: reversed subtyping relation
    5. Use-site variance: specifying variance for type occurrences
    6. Star projection: using * instead of a type argument

Annotations and Reflection

  • Declaring and applying annotations
    1. Applying annotations
    2. Annotation targets
    3. Using annotations to customise JSON serialisation
    4. Declaring annotations
    5. Meta-annotations: controlling how an annotation is processed
    6. Classes as annotation parameters
    7. Generic classes as annotation parameters
  • Reflection: Introspecting Kotlin objects at runtime
    1. The Kotlin reflection API:
    2. KClass, KCallable, KFunction, and KProperty
    3. Implementing object serialization using reflection
    4. Customizing serialization with annotations
    5. JSON parsing and object deserialization
    6. Final deserialization step:
    7. callBy() and creating objects using reflection

Coroutines in Kotlin

  • Coroutines
    1. Coroutines Basics
    2. Cancellation and Timeouts
    3. Blocking vs Suspending
    4. Composing Suspending Functions
    5. Coroutine Context and Dispatchers
    6. Asynchronous Flow
    7. Channels
    8. Exception Handling and Supervision
    9. Shared Mutable State and Concurrency
  • Standard APIs
    1. Low Level API: kotlin.coroutines
    2. Generators API in kotlin.coroutines
    3. Other High Level APIs in kotlin.coroutines
TENHO INTERESSE

Cursos Relacionados

Curso Python Programação Advanced

32 horas

Curso SAP ABAP S4hana Developer Foundation

32 horas

Curso Full Stack and React Essentials

32 Horas

Curso Node.js for JavaScript Developers

24 horas

Curso Elasticsearch for Developers

16H

Curso Elastic Stack Foundation

24 horas

Curso Apache Spark™ Foundation

8 Horas