28,79 €
As an application’s code base increases, it becomes harder for developers to maintain existing features and introduce new ones. In this clean architecture book, you'll learn to identify when and how this problem emerges and how to structure your code to overcome it.
The book starts by explaining clean architecture principles and Android architecture components and then explores the tools, frameworks, and libraries involved. You’ll learn how to structure your application in the data and domain layers, the technologies that go in each layer, and the role that each layer plays in keeping your application clean. You’ll understand how to arrange the code into these two layers and the components involved in assembling them. Finally, you'll cover the presentation layer and the patterns that can be applied to have a decoupled and testable code base.
By the end of this architecture book, you'll be able to build an application following clean architecture principles and have the knowledge you need to maintain and test the application easily.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 318
Veröffentlichungsjahr: 2022
Take a layered approach to writing clean, testable, and decoupled Android applications
Alexandru Dumbravan
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: Rohit Rajkumar
Publishing Product Manager: Nitin Nainani
Senior Editor: Aamir Ahmed
Content Development Editor: Feza Shaikh
Technical Editor: Simran Udasi
Copy Editor: Safis Editing
Project Coordinator: Manthan Patel
Proofreader: Safis Editing
Indexer: Rekha Nair
Production Designer: Shyam Sundar Korumilli
Marketing Coordinator: Teny Thomas
First published: June 2022
Production reference: 2280922
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80323-458-8
www.packt.com
This book is dedicated to all the developers who went the extra mile to learn, practice, hack, innovate, and then pass their knowledge on to others. This propelled our development world forward and made this book a possibility. This book is also dedicated to all the people in my life who supported me through the times I was staring desperately at a computer screen filled with compile errors.
Alexandru Dumbravan
“If you think good architecture is expensive, try bad architecture.”
— Brian Foote, CEO of HUMBL
We know deep down that this statement is true. Poorly architected code can cause problems in your application, but it can also make your code hard to understand, navigate, be improved upon, and difficult to use for other developers.
“The glass is neither half empty nor half full. It’s simply larger than it needs to be.”
— Grace Hopper
Grace Hopper was an American computer scientist and Navy officer. She knew the importance of a well-structured and clean architecture. They’re flexible, higher performing, far more scalable, easier to test, and you can maintain them a lot faster and more easily. A clean architecture is focused on getting the application layers built as efficiently as possible, without leaving behind (as Grace might say) leftover cup.
In a mobile application, clean architecture is more important than ever. You might find yourself battling against battery issues, memory consumption issues, security problems, compatibility, or environmental changes. Your mobile application needs to truly achieve portability.
In Clean Android Architecture, Alexandru Dumbravan applies his experience of developing Android applications for over 10 years. He takes you through a quick tour of the core software design principles and through the key features in the Android framework and supporting libraries.
Next, you’ll dig deep in data sources. It’s vital to understand the libraries and frameworks that are available for you to access and manage data. Then, Alexandru naturally transitions into data presentation. How do you present data to the user? You’ll break down how the user interface (UI) works and how to build your own UI solution.
Later, you’ll learn how to manage dependencies. Part of the value that Alexandru brings to the book is that he shows you how these different challenges were handled in the past, and what has changed over time. You’ll then see how to build the domain layer to sit in the center of your application and to control your app logic. Next, you’ll build the data layer to create and manage your data. The presentation layer handles the UI and the input/output. Finally, you’ll put the modules together and test your application.
By building an Android application with a clean architecture, you’ll be able to put every piece of your code to work, and you’ll end up with a far more scalable, performant, and maintainable application. This is a book that you’ll want to come back to, to make sure you’ve got each step of this process down. And once you do, well, we all know that the present and future is in mobile applications. So, the question is, where are you taking us?
Ed Price Senior Program Manager of Architectural Publishing Microsoft, Azure Architecture Center (http://aka.ms/Architecture)Co-Author of 7 Books, including Meg the Mechanical Engineer, The Azure Cloud Native Architecture Mapbook (Packt), and ASP.NET Core 5 for Beginners (Packt)
Alexandru Dumbravan has been an Android developer since 2011 and has worked across a variety of Android applications that have contained features such as messaging, voice calls, file management, and file management. He continues to broaden his development skills while working in London for a popular fintech company.
Revathi Gopalakrishnan is a software professional with 20 years of experience in the IT industry. She has worked extensively in mobile application development and has led various enterprise mobile enablement initiatives for large organizations and consumer applications for customers around the globe. She is also interested in emerging areas, such as machine learning, IoT, and robotic process automation. She has authored a book with Packt titled Mobile Machine Learning. Revathi resides in Chennai and enjoys spending her weekends with her husband and her two lovely daughters.
Jose Miguel is a software engineer who specializes in mobile development, with 5 years of experience. He has an Android associate developer certification from Google. He is also involved in the start-up tech community as a mentor in the OpenLab Peru community, bringing guidance to new Android developers and entrepreneurs who want to gain certain expertise in the mobile world. He resides in Lima, Peru, and enjoys watching movies, reading comics, boxing, traveling, and learning about new cultures and people around the world.
In this part, you will become familiar with the notion of clean architecture and the principles it provides. This part also explores the tools, frameworks, and libraries used later in the book.
This part includes the following chapters:
Chapter 1, Getting Started with Clean ArchitectureChapter 2, Deep Diving into Data SourcesChapter 3, Understanding Data Presentation on AndroidChapter 4, Managing Dependencies in Android Applications