Hands-On Object-Oriented Programming with Kotlin
eBook - ePub

Hands-On Object-Oriented Programming with Kotlin

Build robust software with reusable code using OOP principles and design patterns in Kotlin

  1. 370 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Object-Oriented Programming with Kotlin

Build robust software with reusable code using OOP principles and design patterns in Kotlin

About this book

Learn everything you need to know about object-oriented programming with the latest features of Kotlin 1.3

Key Features

  • A practical guide to understand objects and classes in Kotlin
  • Learn to write asynchronous, non-blocking codes with Kotlin coroutines
  • Explore Encapsulation, Inheritance, Polymorphism, and Abstraction in Kotlin

Book Description

Kotlin is an object-oriented programming language. The book is based on the latest version of Kotlin. The book provides you with a thorough understanding of programming concepts, object-oriented programming techniques, and design patterns. It includes numerous examples, explanation of concepts and keynotes. Where possible, examples and programming exercises are included.

The main purpose of the book is to provide a comprehensive coverage of Kotlin features such as classes, data classes, and inheritance. It also provides a good understanding of design pattern and how Kotlin syntax works with object-oriented techniques. You will also gain familiarity with syntax in this book by writing labeled for loop and when as an expression. An introduction to the advanced concepts such as sealed classes and package level functions and coroutines is provided and we will also learn how these concepts can make the software development easy. Supported libraries for serialization, regular expression and testing are also covered in this book. By the end of the book, you would have learnt building robust and maintainable software with object oriented design patterns in Kotlin.

What you will learn

  • Get an overview of the Kotlin programming language
  • Discover Object-oriented programming techniques in Kotlin
  • Understand Object-oriented design patterns
  • Uncover multithreading by Kotlin way
  • Understand about arrays and collections
  • Understand the importance of object-oriented design patterns
  • Understand about exception handling and testing in OOP with Kotlin

Who this book is for

This book is for programmers and developers who wish to learn Object-oriented programming principles and apply them to build robust and scalable applications. Basic knowledge in Kotlin programming is assumed

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Object-Oriented Patterns in Kotlin

A pattern is a concept that relates to software architecture. By architecture, we mean a high-level structure of programming code that includes elements and relationships. It's important to make the right decision when it comes to a pattern that will be used to solve everyday problems. This is because choosing and implementing a pattern is a one-time procedure that is expensive to change.
Before we begin, let's review the topics we will be looking at in this chapter:
  • What design patterns are and how they help
  • Types of design patterns
  • Creational patterns
  • Structural patterns
  • Behavioral patterns

Technical requirements

To run the code from this chapter, we just need IntelliJ IDEA as well as Git installed. This chapter doesn't require any additional installations.
You can find examples from this chapter on GitHub at the following link: https://github.com/PacktPublishing/Hands-On-Object-Oriented-Programming-with-Kotlin/tree/master/src/main/kotlin/Chapter06.

What design patterns are and how they help

The process of software development involves creating new classes and interfaces, building an inheritance hierarchy, and establishing communication between objects. Object-oriented programming helps us to build an abstraction of entities and processes using extremely powerful concepts such as encapsulations, composition, inheritance, polymorphism, and so on and so forth.
We should understand that a developer writes code to solve one or more sets of problems. Software designing is a process of describing how to apply the concepts of object-oriented programming together to implement a solution.
An implementation of a commonly occurring solution is a software design pattern if it can be reused in many different situations. The most common reasons to use a design template are as follows:
  • Acceleration of the development process
  • Increasing the quality of code
  • Decreasing communication time between developers
Reusing patterns helps us to prevent common issues, which is why we can increase the quality of code. It also improves readability and understanding for developers who are familiar with a pattern that decreases the time for communication and code review. As a result, we can speed up the development process.
Software design patterns in object-oriented programming show relationships and communic...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. Packt Upsell
  5. Contributors
  6. Preface
  7. Getting Started with Kotlin
  8. Introduction to Object-Oriented Programming
  9. The Four Pillars of Object-Oriented Programming
  10. Classes - Advanced Concepts
  11. Data Collection, Iterators, and Filters
  12. Object-Oriented Patterns in Kotlin
  13. Coroutines - a Lightweight Thread?
  14. Interoperability
  15. Regular Expression and Serialization in Kotlin
  16. Exception Handling
  17. Testing in Object-Oriented Programming with Kotlin
  18. Assessments
  19. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Hands-On Object-Oriented Programming with Kotlin by Abid Khan, Igor Kucherenko in PDF and/or ePUB format, as well as other popular books in Informatica & Programmazione orientata agli oggetti. We have over one million books available in our catalogue for you to explore.