Kotlin In-Depth  
A Guide to a Multipurpose Programming Language for Server-Side, Front-End, Android, and Multiplatform Mobile
Author(s): Aleksei Sedunov
Published by BPB Publications
Publication Date:  Available in all formats
ISBN: 9789391030636
Pages: 688

EBOOK (EPUB)

ISBN: 9789391030636 Price: INR 1099.00
Add to cart Buy Now
The book ‘Kotlin In-Depth, Second Edition’ updates all the essential parts of Kotlin and incorporates modern principles, methodologies, and approaches for achieving efficient solutions. The book will guide you to successfully utilize Kotlin in developing JVM apps for desktop, mobile, web platforms and transferring existing Java codebases to Kotlin. The book begins with an introduction to the language and its environment, which will help you to grasp the fundamental concepts underlying Kotlin's design. The readers will learn the Kotlin tooling and the language's core syntax and structures. The book teaches Kotlin's multi-paradigm nature, which enables the creation of powerful abstractions by mixing parts of functional and object-oriented programming. This book discusses how to use standard Kotlin APIs like the standard library, reflection, and coroutine-based concurrency, as well as how to create your flexible APIs using domain-specific languages. The book demonstrates how to use Kotlin for more specific tasks such as testing, developing Android applications, developing Web applications, and developing microservices. After reading this book, you'll be prepared to dive deeper into the Kotlin ecosystem's more specialized areas, including Android applications, server-side development, native programming, and code sharing across different platforms.
Rating
Description
The book ‘Kotlin In-Depth, Second Edition’ updates all the essential parts of Kotlin and incorporates modern principles, methodologies, and approaches for achieving efficient solutions. The book will guide you to successfully utilize Kotlin in developing JVM apps for desktop, mobile, web platforms and transferring existing Java codebases to Kotlin. The book begins with an introduction to the language and its environment, which will help you to grasp the fundamental concepts underlying Kotlin's design. The readers will learn the Kotlin tooling and the language's core syntax and structures. The book teaches Kotlin's multi-paradigm nature, which enables the creation of powerful abstractions by mixing parts of functional and object-oriented programming. This book discusses how to use standard Kotlin APIs like the standard library, reflection, and coroutine-based concurrency, as well as how to create your flexible APIs using domain-specific languages. The book demonstrates how to use Kotlin for more specific tasks such as testing, developing Android applications, developing Web applications, and developing microservices. After reading this book, you'll be prepared to dive deeper into the Kotlin ecosystem's more specialized areas, including Android applications, server-side development, native programming, and code sharing across different platforms.
Table of contents
  • Cover Page
  • Title Page
  • Copyright Page
  • Dedication Page
  • About the Author
  • About the Reviewers
  • Acknowledgements
  • Preface
  • Errata
  • Table of Contents
  • 1. Kotlin - Powerful and Pragmatic
    • Structure
    • Objectives
    • What is Kotlin?
      • Safe
      • Multiparadigm
      • Concise and expressive
      • Interoperable
      • Multiplatform
      • Kotlin ecosystem
      • Coroutines
      • Testing frameworks
      • Android development
      • Web development
      • Desktop applications
      • Getting started with Kotlin
      • Setting up an IntelliJ project
      • Using REPL
      • Interactive editors
      • Setting up an Eclipse project
    • Conclusion
    • Points to remember
    • Questions
  • 2. Language Fundamentals
    • Structure
    • Objectives
    • Basic syntax
      • Comments
      • Defining a variable
      • Identifiers
      • Mutable variables
      • Expressions and operators
    • Primitive types
      • Integer types
      • Floating-point types
      • Arithmetic operations
      • Bitwise operations
      • Char type
      • Numeric conversions
      • Boolean type and logical operations
      • Comparison and equality
    • Strings
      • String templates
      • Basic string operations
    • Arrays
      • Constructing an array
      • Using arrays
    • Conclusion
    • Points to remember
    • Multiple choice questions
      • Answers
    • Questions
  • 3. Defining Functions
    • Structure
    • Objective
    • Functions
      • Function anatomy
      • Trailing commas
      • Positional vs named arguments
      • Overloading and default values
      • Varargs
      • Function scope and visibility
    • Packages and imports
      • Packages and directory structure
      • Using import directives
    • Conditionals
      • Making decisions with if statements
      • Ranges, progressions, and in operation
      • when statements and multiple choice
    • Loops
      • while/do-while loop
      • Iterables and for loop
      • Changing loop control-flow: break and continue
      • Nested loops and labels
      • Tail-recursive functions
    • Exception handling
      • Throwing an exception
      • Handling errors with try statements
    • Conclusion
    • Points to remember
    • Multiple choice questions
      • Answers
    • Questions
    • Key terms
  • 4. Working with Classes and Objects
    • Structure
    • Objectives
    • Defining a class
      • A class anatomy
      • Constructors
      • Member visibility
      • Nested classes
      • Local classes
    • Nullability
      • Nullable types
      • Nullability and smart casts
      • Not-null assertion operator
      • Safe call operator
      • Elvis operator
    • Properties: Beyond simple variables
      • Top-level properties
      • Late initialization
      • Using custom accessors
      • Lazy properties and delegates
    • Objects and companions
      • Object declarations
      • Companion objects
      • Object expressions
    • Conclusion
    • Points to remember
    • Multiple choice questions
      • Answers
    • Questions
    • Key terms
  • 5. Leveraging Advanced Functions and Functional Programming
    • Structure
    • Objective
    • Functional programming in Kotlin
      • Higher-order functions
      • Functional types
      • Lambdas and anonymous functions
      • Callable references
      • Inline functions and properties
      • Non-local control flow
    • Extensions
      • Extension functions
    • Extension properties
      • Companion extensions
      • Lambdas and functional types with the receiver
      • Callable references with receiver
      • Scope functions
      • run / with
      • run without context
      • let
      • apply / also
      • Extensions as class members
    • Conclusion
    • Points to remember
    • Questions
    • Key terms
  • 6. Using Special-Case Classes
    • Structure
    • Objective
    • Enum classes
      • Exhaustive when expressions
      • Declaring enums with custom members
      • Using common members of enum classes
    • Data classes
      • Data classes and their operations
      • Destructuring declarations
    • Inline classes
      • Defining an inline class
      • Unsigned integers
    • Conclusion
    • Points to remember
    • Questions
    • Key terms
  • 7. Exploring Collections and I/O
    • Structure
    • Objective
    • Collections
      • Collection types
      • Iterables
      • Collections, lists, and sets
      • Sequences
      • Maps
      • Comparables and comparators
      • Creating a collection
      • Basic operations
      • Accessing collection elements
      • Collective conditions
      • Aggregation
      • Filtering
      • Transformation
      • Extracting subcollections
      • Ordering
    • Files and I/O streams
      • Stream utilities
      • Creating streams
      • URL utilities
      • Accessing file content
      • File system utilities
    • Conclusion
    • Points to remember
    • Multiple choice questions
      • Answers
    • Questions
  • 8. Understanding Class Hierarchies
    • Structure
    • Objective
    • Inheritance
      • Declaring a subclass
      • Subclass initialization
      • Type Checking and Casts
      • Common methods
    • Abstract classes and interfaces
      • Abstract classes and members
      • Interfaces
      • Sealed classes
      • Delegation
    • Conclusion
    • Points to remember
    • Multiple choice questions
      • Answers
    • Questions
  • 9. Generics
    • Structure
    • Objective
    • Type parameters
      • Generic declarations
      • Bounds and constraints
      • Type erasure and reification
    • Variance
      • Variance: Distinguishing producers and consumers
      • Variance at the declaration site
      • Use-site variance with projections
      • Star projections
    • Type aliases
    • Conclusion
    • Points to remember
    • Questions
  • 10. Annotations and Reflection
    • Structure
    • Objectives
    • Annotations
      • Defining and using annotation classes
      • Built-in annotations
    • Reflection
      • Reflection API overview
      • Classifiers and types
      • Callables
    • Conclusion
    • Questions
  • 11. Domain-Specific Languages
    • Structure
    • Objective
      • Operator overloading
      • Unary operations
      • Increments and decrements
      • Binary operations
      • Infix operations
      • Assignments
      • Invocations and indexing
      • Destructuring
      • Iteration
    • Delegated properties
      • Standard delegates
      • Creating custom delegates
      • Delegate representation
    • Higher-order functions and DSLs
      • Fluent DSL with infix functions
      • Using type-safe builders
      • @DslMarker
    • Conclusion
    • Questions
  • 12. Java Interoperability
    • Structure
    • Objective
    • Using Java code from Kotlin
      • Java methods and fields
      • Unit vs void
      • Operator conventions
      • Synthetic properties
      • Platform types
      • Nullability annotations
      • Java/Kotlin type mapping
      • Single abstract method interfaces
      • Working with Java records
      • Using the Java-to-Kotlin converter
    • Using the Kotlin code from Java
      • Accessing properties
      • File facades and top-level declarations
      • Objects and static members
      • Changing the exposed declaration name
      • Generating overloads
      • Declaring exceptions
      • Inline functions
      • Type aliases
      • Exposing Kotlin classes as Java records
    • Conclusion
    • Questions
  • 13. Concurrency
    • Structure
    • Objective
    • Coroutines
      • Coroutines and suspending functions
      • Coroutine builders
      • Coroutine scopes and structured concurrency
      • Coroutine context
    • Coroutine control-flow
      • Job lifecycle
      • Cancellation
      • Timeouts
      • Coroutine dispatching
      • Exception handling
    • Concurrent communication
      • Channels
      • Producers
      • Tickers
      • Flows
      • Actors
    • Using Java concurrency
      • Starting a thread
      • Synchronization and locks
    • Coroutine debugger
    • Conclusion
    • Questions
  • 14. Testing with Kotlin
    • Structure
    • Objective
    • KotlinTest specifications
      • Getting started with KotlinTest
      • Specification styles
    • Assertions
      • Matchers
      • Inspectors
      • Handling exceptions
      • Testing non-deterministic code
      • Property-based testing
    • Fixtures and configurations
      • Providing a fixture
      • Test configuration
    • Conclusion
    • Questions
  • 15. Android Applications
    • Structure
    • Objective
    • Getting started with Android
      • Setting up an Android Studio project
      • Gradle build scripts
      • Activity
      • Using an emulator
    • Activities
      • Designing an application UI
      • Implementing an activity class
      • View binding
      • Preserving the activity state
    • Conclusion
    • Questions
  • 16. Web Development with Ktor
    • Structure
    • Objective
    • Introducing Ktor
    • Server features
      • Routing DSL
      • Handling calls
      • HTML DSL
      • Sessions support
    • Client features
      • Requests and responses
      • Cookies
    • Conclusion
    • Questions
  • 17. Building Microservices
    • Structure
    • Objectives
    • The microservice architecture
    • Introducing Spring Boot
      • Setting up a project
      • Deciding on the Services API
      • Implementing a random generator service
      • Implementing a password generator service
    • Microservices with Ktor
      • Using the JSON serialization feature
      • Implementing a password generator service
    • Conclusion
    • Questions
  • Index
User Reviews
Rating