![Kotlin In-depth [Vol-II]: A comprehensive guide to modern multi-paradigm language Front Cover](https://m.media-amazon.com/images/I/41PdkIHJcrL.jpg)
Kotlin In-depth [Vol-II]: A comprehensive guide to modern multi-paradigm language
- Length: 276 pages
- Edition: 1
- Language: English
- Publisher: BPB Publications
- Publication Date: 2020-03-07
- ISBN-10: 9389423228
- ISBN-13: 9789389423228
- Sales Rank: #3476803 (See Top 100 Books)
Master the concise and expressive power of a pragmatic multi-paradigm language for JVM, Android and beyond
Key Features
- Language fundamentals
- Object-oriented and functional programming with Kotlin
- Kotlin standard library
- Building domain-specific languages
- Using Kotlin for Web development
- Kotlin for Android platform
- Coroutine-based concurrency
Description
The purpose of this book is to guide a reader through the capabilities of the Kotlin language and give examples of using it for development of various applications be it desktop, mobile or Web. Although our primary focus is on the JVM and Android, the knowledge we’re sharing here to various extents applies to other Kotlin-supported platforms such as JavaScript, native and even multi-platform applications.The book starts with an introduction to language and its ecosystem that will give you an understanding of the key ideas behind Kotlin design, introduce you to the Kotlin tooling and present you the basic language syntax and constructs. In the next chapters we’ll get to know the multi-paradigm nature of Kotlin which allows you to create powerful abstractions by combining various aspects of functional and object-oriented programming. We’ll talk about using common Kotlin APIs such as the standard library, reflection, and coroutine-based concurrency as well as the means for creating your own flexible APIs based on domain-specific languages. In the concluding chapters, we’ll give examples of using Kotlin for more specialized tasks such as testing, building Android applications, Web development and creating microservices.
What will you learn
By the end of the book, you’ll obtain a thorough knowledge of all basic aspects of Kotlin programming. You’ll be able to create a flexible and reusable code by taking advantage of object-oriented and functional features, use Kotlin standard library, compose your own domain-specific languages, write asynchronous code using Kotlin coroutines library as well. You’ll also have a basic understanding of using Kotlin for writing test code, web applications and Android development. This knowledge will also give you a solid foundation for deeper learning of related development platforms, tools and frameworks.
Who this book is for
The book is primarily aimed at developers familiar with Java and JVM and willing to get a firm understanding of Kotlin while having little to no experience in that language. Discussion of various language features will be accompanied, if deemed necessary, by comparisons with their Java’s analogs which should simplify Java-to-Kotlin transition. Most of the material, however, is rather Java-agnostic and should be beneficial even without prior Java knowledge. In general, experience in object-oriented or functional paradigm is a plus, but not required.
Cover Page Title Page Copyright Page Dedication About the Author Acknowledgement Preface Errata Table of Contents 10. Annotations and Reflection Structure Objective 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 Objectives Using the 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 Using 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 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 Actors Using Java concurrency Starting a thread Synchronization and locks 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 the application UI Implementing the activity class Kotlin Android Extensions Preserving the activity state Anko Layouts Conclusion Questions 16. Web Development with Ktor Structure Objective Introducing Ktor Server features Routing Handling HTTP requests 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
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.