33,59 €
Refactoring in Java serves as an indispensable guide to enhancing your codebase’s quality and maintainability.
The book begins by helping you get to grips with refactoring fundamentals, including cultivating good coding habits and identifying red flags. You’ll explore testing methodologies, essential refactoring techniques, and metaprogramming, as well as designing a good architecture. The chapters clearly explain how to refactor and improve your code using real-world examples and proven techniques. Part two equips you with the ability to recognize code smells, prioritize tasks, and employ automated refactoring tools, testing frameworks, and code analysis tools. You’ll discover best practices to ensure efficient code improvement so that you can navigate complexities with ease. In part three, the book focuses on continuous learning, daily practices enhancing coding proficiency, and a holistic view of the architecture. You’ll get practical tips to mitigate risks during refactoring, along with guidance on measuring impact to ensure that you become an efficient software craftsperson.
By the end of this book, you’ll be able to avoid unproductive programming or architecturing, detect red flags, and propose changes to improve the maintainability of your codebase.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Veröffentlichungsjahr: 2023
Refactoring in Java
Improving code design and maintainability for Java developers
Stefano Violetta
BIRMINGHAM—MUMBAI
Copyright © 2023 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: Kunal Sawant
Publishing Product Manager: Teny Thomas
Senior Content Development Editor: Rosal Colaco
Technical Editor: Vidhisha Patidar
Copy Editor: Safis Editing
Project Manager: Prajakta Naik
Project Coordinator: Manisha Singh
Indexer: Pratik Shirodkar
Production Designer: Ponraj Dhandapani
DevRel Marketing Coordinator: Shrinidhi Manoharan
Business Development Executive: Kriti Sharma
First published: December 2023
Production reference:1081223
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK.
ISBN 978-1-80512-663-8
www.packtpub.com
I dedicate this book to Cristina, the love of my life, and my children, Alessandro and Andrea.
I believe, in life, the most important thing is to keep learning and getting better.
Thanks for showing me something new every day.
– Stefano
Stefano Violetta is a creative backend engineer, bringing over 15 years of experience in software development and architecture. He has worked in a diverse range of companies, spanning from startups to industry giants like eBay. Stefano takes pride in crafting meticulously written code to build sophisticated applications that align with their intended purpose, ensuring functionality and meeting the precise needs of users. Or at least, he tries to! Beyond the world of software, Stefano enjoys immersing himself in reading and watching movies during his free time.
Giuseppe Bonocore is a senior IT professional, with more than 15 years of experience in the software industry, with different roles. His competencies include cloud technologies, modern software architectures, data, and AI. He has a master’s degree in computer science. He is passionate about open source and the impact of digitalization on organizations and has been speaking at many important technical conferences. In 2021, he published a book about cloud-native applications development. His professional experiences include Salesforce, Red Hat, Accenture, and Docomo Digital, covering many technical leadership roles and deploying huge transformation projects across Europe.
Siddhesh Nikude is a software craftsperson who believes in improving the world’s software development by writing better software and teaching others how to do it. He carries over 10+ years of experience and prefers calling himself a generalist.
Siddhesh started his career as a smart card developer, where he was introduced to Clean Code and XP. It was then he started working in an iterative and incremental approach to notice effective results. Not only does it improve the design and safety of the software, but it also improves the lives of the people working on it. He has worked in a variety of roles from developer to transformation coach on a variety of projects. He has mentored teams in B/TDD, mutation and micro testing, CI/CD pipelines, XP/Lean practices, Clean Code and SOLID principles, DORA metrics, Monte-Carlo simulation, Scrum, Delivery Automation, Test Pyramid, User Stories/Slicing, and Chartering. As a developer, he has worked with Java, Kotlin, Go, TypeScript, React-Native, and so on.
We will start by defining what is meant by “refactoring” and why it is an important practice in software development. We will also cover the benefits of refactoring and the situations in which it is appropriate to use it. We will delve into the specific areas of code that developers should consider refactoring, providing guidance on how to identify and prioritize areas for improvement.
Then we’ll cover the topic of writing high-quality code by day-to-day habits, which each professional should interiorize. We’re going to start by discussing what distinguishes good code from bad code and briefly explore the concept of clean code. Then we’ll delve into the SOLID principles of software design, the importance of (not using) side effects, mutability, and common causes of bad code.
This part has the following chapters:
Chapter 1, What is Refactoring?Chapter 2, Good Coding Habits