29,99 €
This book shows you how easy it can be to implement traditional design patterns in the modern multi-paradigm Kotlin programming language, and takes you through the new patterns and paradigms that have emerged.
This second edition is updated to cover the changes introduced from Kotlin 1.2 up to 1.5 and focuses more on the idiomatic usage of coroutines, which have become a stable language feature. You'll begin by learning about the practical aspects of smarter coding in Kotlin, as well as understanding basic Kotlin syntax and the impact of design patterns on your code.
The book also provides an in-depth explanation of the classical design patterns, such as Creational, Structural, and Behavioral families, before moving on to functional programming. You'll go through reactive and concurrent patterns, and finally, get to grips with coroutines and structured concurrency to write performant, extensible, and maintainable code.
By the end of this Kotlin book, you'll have explored the latest trends in architecture and design patterns for microservices. You’ll also understand the tradeoffs when choosing between different architectures and make informed decisions.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 357
Veröffentlichungsjahr: 2022
Build scalable applications using traditional, reactive, and concurrent design patterns in Kotlin
Alexey Soshin
BIRMINGHAM—MUMBAI
Copyright © 2022 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Aaron Lazar
Publishing Product Manager: Sathyanarayanan Ellapulli
Senior Editor: Rohit Singh
Content Development Editor: Rosal Colaco
Technical Editor: Karan Solanki
Copy Editor: Safis Editing
Project Coordinator: Deeksha Thakkar
Proofreader: Safis Editing
Indexer: Manju Arasan
Production Designer: Jyoti Chauhan
Marketing Coordinator: Sonakshi Bubbar
First published: June 2018
Second edition: December 2021
Production reference: 1131221
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80181-572-7
www.packt.com
To Lula Leus, my constant source of inspiration.
To my mentor, Lior Bar On. Without you, I would have never started writing.
– Alexey Soshin
Kotlin just turned 10 recently. It's a relatively young programming language. However, Kotlin stands on the shoulders of giants: many features and best practices have been borrowed from other programming languages. Thanks to this, we can reuse the knowledge that we have learned elsewhere when developing Kotlin programs.
Design patterns are part of the best practices that will help developers to use Kotlin efficiently. It is great to see the effort in describing the patterns that comes from the passionate people in the Kotlin community. Alexey Soshin has put a lot of effort into sharing his knowledge, not only in this book but also in interactive courses and other media.
Kotlin Design Patterns and Best Practices provides a gentle introduction to the Kotlin programming language. It guides you through the vocabulary of design patterns chapter by chapter. If you are a Java developer and have used design patterns previously, the book will show you how to do the same with Kotlin.
Design patterns appeared in the era of object-oriented languages such as C++ and Java. Kotlin, however, provides language features that allow developers to program in a functional style. This book captures the benefits of the functional approach and explains how to apply it with Kotlin.
A sizable part of this book covers asynchronous programming with Kotlin coroutines. Today, it's essential to understand how to write concurrent programs and use the asynchronous programming approach to implement concurrency in your programs. This understanding is also critical for designing these programs correctly. Concurrency design patterns will help you understand how to develop concurrent programs better.
This book will give you a solid grounding for becoming familiar with Kotlin and best practices for building programs with this modern programming language. I salute the author for his effort and enthusiasm!
Anton Arhipov
Kotlin Developer Advocate at JetBrains
Alexey Soshin is a software architect with 15 years of experience in the industry. He started exploring Kotlin when Kotlin was still in beta, and since then has been a big enthusiast of the language. He's a conference speaker, published writer, and the author of a video course titled Pragmatic System Design.
Aditya Kumar is an Android developer with around 4 years of experience in this domain. In his journey so far, he has worked with companies such as Microsoft and Uber. He has helped in developing a few key components of many projects and is always known for his contribution to the Kotlin community. Besides Android development, he is also interested in other technologies such as engineering systems and backend engineering and is very keen on exploring those aspects in the future.
Nicola Corti is a Google Developer Expert for Kotlin. He has been working with the language since before version 1.0 and he is the maintainer of several open source libraries and tools for mobile developers (Detekt, Chucker, AppIntro, and so on). He's currently working in the React Native team at Meta in London, UK, helping to build and ship one of the most popular cross-platform frameworks for mobile. Furthermore, he is an active member of the developer community. His involvement ranges from speaking at international conferences to being a member of CFP committees and supporting developer communities across Europe.
Joost Heijkoop is an independent consultant, a seasoned JVM and frontend developer working to make things better and tackle hard problems, and an organizer at Kotlin.amsterdam and Amsterdam.scala, and is always happy to help.
In this section, we will cover the basic syntax of the Kotlin programming language and the implementation of all the classical design patterns in Kotlin.
The classical design patterns deal with three major problems in system design: how to create objects efficiently, how to encapsulate object hierarchies, and how to make object behavior more dynamic.
We'll discuss which design patterns come as part of the language, and how to implement those that don't.
This section comprises the following chapters:
Chapter 1, Getting Started with Kotlin Chapter 2, Working with Creational PatternsChapter 3, Understanding Structural PatternsChapter 4, Getting Familiar with Behavioral Patterns