Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Get Your Hands Dirty on Clean Architecture
Get Your Hands Dirty on Clean Architecture

Get Your Hands Dirty on Clean Architecture: Build 'clean' applications with code examples in Java , Second Edition

Arrow left icon
Profile Icon Tom Hombergs
Arrow right icon
NZ$14.99 NZ$52.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (24 Ratings)
eBook Jul 2023 168 pages 2nd Edition
eBook
NZ$14.99 NZ$52.99
Paperback
NZ$65.99
Subscription
Free Trial
Arrow left icon
Profile Icon Tom Hombergs
Arrow right icon
NZ$14.99 NZ$52.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (24 Ratings)
eBook Jul 2023 168 pages 2nd Edition
eBook
NZ$14.99 NZ$52.99
Paperback
NZ$65.99
Subscription
Free Trial
eBook
NZ$14.99 NZ$52.99
Paperback
NZ$65.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Get Your Hands Dirty on Clean Architecture

Maintainability

This book is about software architecture. One of the definitions of architecture is the structure of a system or process. In our case, it’s the structure of a software system.

Architecture is designing this structure with a purpose. We’re consciously designing our software system to fulfill certain requirements. There are functional requirements that the software has to fulfill to create value for its users. Without functionality, software is worthless, because it produces no value.

There are also quality requirements (also called non-functional requirements) that the software should fulfill to be considered high quality by its users, developers, and stakeholders. One such quality requirement is maintainability.

What would you say if I told you that maintainability as a quality attribute, in a way, is more important than functionality and that we should design our software for maintainability over everything else? Once we have established maintainability...

What does maintainability even mean?

Before you write me off as a lunatic and start looking for options to return this book, let me explain what I mean by maintainability.

Maintainability is only one of the many quality requirements that potentially make up a software architecture. I asked ChatGPT for a list of quality requirements, and this is the result:

  • Scalability
  • Flexibility
  • Maintainability
  • Security
  • Reliability
  • Modularity
  • Performance
  • Interoperability
  • Testability
  • Cost-effectiveness

The list doesn’t end here.1

1 For some inspiration about software quality (which has been created by humans, and not a language model), have a look at https://quality.arc42.org/.

As software architects, we design our software to fulfill the quality requirements that are most important for the software. For a high-throughput trading application, we might focus on scalability and reliability. For an application dealing with personally...

Maintainability enables functionality

Now back to my claim that maintainability is more important than functionality from the beginning of this chapter.

If you ask a product person what’s most important in a software project, they’ll tell you that the value the software provides to its users is the most important thing. Software that doesn’t provide value to its users means that users don’t pay for it. And without paying users, we don’t have a working business model, which is the main measure of success in the business world.

So, our software needs to provide value. But it shouldn’t provide value at the cost of maintainability.2 Think about how much more efficient and joyful it is to add functionality to a software system that is easily changeable as compared to a software system where you have to fight your way through one line of code at a time! I’m pretty sure that you’ve worked on one of those software projects where...

Maintainability generates developer joy

As a developer, would you rather work on software where changes are easy or on software where changes are hard? Don’t answer; it’s a rhetorical question.

Aside from the direct influence on the cost of change, maintainability has another benefit: it makes developers happy (or, depending on the current project they’re working on, it at least makes them less sad).

The term I want to use to describe this happiness is developer joy. It’s also known as developer experience or developer enablement. Whatever we call it, it means that we provide the context developers need to do their work well.

Developer joy is directly related to developer productivity. In general, if developers are happy, they do better work. And if they do good work, they are happier. There’s a two-way correlation between developer joy and developer productivity:

Figure 1.2 – Developer joy influences developer productivity and vice versa

Figure 1.2 – Developer joy influences developer...

Maintainability supports decision-making

When building a software system, we solve problems every day. For most problems we face, there is more than one solution. We have to make decisions to choose between those solutions.

Do we copy this bit of code for the new feature we’re building? Do we create our objects ourselves or do we use a dependency injection framework? Do we use an overloaded constructor to create this object, or do we create a builder?

Many of these decisions we don’t even make consciously. We just apply a pattern or principle we’ve used before that our intuition says will work in the current situation, as follows:

  • We apply don’t repeat yourself (DRY) when we find code duplication
  • We use dependency injection to make the code more testable
  • We introduce a builder to make it simpler to create an object

If we take a look at these and many other well-known patterns, then what is their effect? In many cases, the main...

Maintaining maintainability

Alright, I assume that you believe me that maintainability positively influences developer joy, productivity, and decision-making. How do we know that the changes we make to our code base increase (or at least don’t decrease) maintainability? How do we manage maintainability over time?

The answer to that question is to create and maintain an architecture that makes it easy to create maintainable code. A good architecture makes it easy to navigate the code base. In an easily navigable code base, it’s a breeze to modify existing features or add new features. The dependencies between the components of our application are clear and not tangled. In summary, good architecture increases maintainability:

Figure 1.5 – Software architecture influences maintainability

Figure 1.5 – Software architecture influences maintainability

By extension, a good architecture increases developer joy, developer productivity, developer retention, and decision-making. We could go on and find...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore ways to make your software flexible, extensible, and adaptable
  • Learn new concepts that you can easily blend with your own software development style
  • Develop the mindset of making conscious architecture decisions

Description

Building for maintainability is key to keep development costs low (and developers happy). The second edition of "Get Your Hands Dirty on Clean Architecture" is here to equip you with the essential skills and knowledge to build maintainable software. Building upon the success of the first edition, this comprehensive guide explores the drawbacks of conventional layered architecture and highlights the advantages of domain-centric styles such as Robert C. Martin's Clean Architecture and Alistair Cockburn's Hexagonal Architecture. Then, the book dives into hands-on chapters that show you how to manifest a Hexagonal Architecture in actual code. You'll learn in detail about different mapping strategies between the layers of a Hexagonal Architecture and see how to assemble the architecture elements into an application. The later chapters demonstrate how to enforce architecture boundaries, what shortcuts produce what types of technical debt, and how, sometimes, it is a good idea to willingly take on those debts. By the end of this second edition, you'll be armed with a deep understanding of the Hexagonal Architecture style and be ready to create maintainable web applications that save money and time. Whether you're a seasoned developer or a newcomer to the field, "Get Your Hands Dirty on Clean Architecture" will empower you to take your software architecture skills to new heights and build applications that stand the test of time.

Who is this book for?

This book is for you if you care about the architecture of the software you are building. To get the most out of this book, you must have some experience with web development. The code examples in this book are in Java. If you are not a Java programmer but can read object-oriented code in other languages, you will be fine. In the few places where Java or framework specifics are needed, they are thoroughly explained.

What you will learn

  • Identify potential shortcomings of using a layered architecture
  • Apply varied methods to enforce architectural boundaries
  • Discover how potential shortcuts can affect the software architecture
  • Produce arguments for using different styles of architecture
  • Structure your code according to the architecture
  • Run various tests to check each element of the architecture

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 14, 2023
Length: 168 pages
Edition : 2nd
Language : English
ISBN-13 : 9781805125914
Vendor :
Salesforce
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jul 14, 2023
Length: 168 pages
Edition : 2nd
Language : English
ISBN-13 : 9781805125914
Vendor :
Salesforce
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 213.97
50 Algorithms Every Programmer Should Know
NZ$73.99
The Ultimate Docker Container Book
NZ$73.99
Get Your Hands Dirty on Clean Architecture
NZ$65.99
Total NZ$ 213.97 Stars icon
Banner background image

Table of Contents

17 Chapters
Chapter 1: Maintainability Chevron down icon Chevron up icon
Chapter 2: What’s Wrong with Layers? Chevron down icon Chevron up icon
Chapter 3: Inverting Dependencies Chevron down icon Chevron up icon
Chapter 4: Organizing Code Chevron down icon Chevron up icon
Chapter 5: Implementing a Use Case Chevron down icon Chevron up icon
Chapter 6: Implementing a Web Adapter Chevron down icon Chevron up icon
Chapter 7: Implementing a Persistence Adapter Chevron down icon Chevron up icon
Chapter 8: Testing Architecture Elements Chevron down icon Chevron up icon
Chapter 9: Mapping between Boundaries Chevron down icon Chevron up icon
Chapter 10: Assembling the Application Chevron down icon Chevron up icon
Chapter 11: Taking Shortcuts Consciously Chevron down icon Chevron up icon
Chapter 12: Enforcing Architecture Boundaries Chevron down icon Chevron up icon
Chapter 13: Managing Multiple Bounded Contexts Chevron down icon Chevron up icon
Chapter 14: A Component-Based Approach to Software Architecture Chevron down icon Chevron up icon
Chapter 15: Deciding on an Architecture Style Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(24 Ratings)
5 star 58.3%
4 star 37.5%
3 star 0%
2 star 0%
1 star 4.2%
Filter icon Filter
Top Reviews

Filter reviews by




Bernhard Schenk Jul 31, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Ein aus meiner Sicht sehr gutes und wichtiges Buch für jeden (Backend-)Entwickler, aber auch Software-Architekten - besonders, aber nicht nur, im Umfeld von MicroServices.Tom versteht es sehr gut die Leute auf unterschiedlichsten Erfahrungen abzuholen. Nachfolgend schafft er es einem die Vorteile der Clean Architecture (Hexagonale Architektur) näherzubringen, um dann final die praktische Umsetzung zu erläutern und mit Beispielen zu belegen. Auch die Vorraussetzungen und potentiellen Probleme werden sehr ausführlich dargelegt und aufgelöst. Gerade dieses ist aus meiner Sicht eine Stärke dieses Buchs, da es einem nicht mit theoretischem Wissen zurücklässt, sondern sehr viele praktische Lösungsschablonen an die Hand gibt.Sehr positiv auch die Ausblicke in die Sicherstellung der Pattern / Architektur-Constraints, so dass auch hier die Softwareerosion proaktiv vermieden, verzögert werden kann.Wenn ich mir noch was wünschen könnte, dann hätte ich gerne ergänzende Beispiele in einer zweiten Programmiersprache.
Amazon Verified review Amazon
emmanouil fotiadis May 28, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
One of the best books I have ever read. Very helpful to understand the actual structure of a project
Amazon Verified review Amazon
mgustav Dec 09, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book offers a treasure trove of practical and theoretical insights into Clean Architecture. The balanced deliberations on the judicious use of shortcuts make it a standout.
Amazon Verified review Amazon
Celil U. Aug 10, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The author provides detailed explanations on how to create maintainable software. To clarify, he offers a comprehensive description of what maintainable software is and the benefits it offers. Through reading about his experiences in previous projects, readers get the impression that the author has devoted significant time to the development of maintainable software architecture.Using an example software project available on GitHub, he demonstrates the process of creating maintainable software, from layered to hexagonal architecture. In doing so, he delves into two principles of SOLID: Dependency Inversion and Single Responsibility. He also elucidates the significance of Domain Driven Design (DDD) and its relevance in crafting a maintainable architecture.After each chapter, the author succinctly explains why the covered content is essential for a maintainable architecture, allowing readers to effortlessly grasp his reasoning.While the author offers valuable insights on creating maintainable software using a simple example, some readers might yearn for guidance on applying these insights to larger projects, depending on their requirements. Nonetheless, the author concludes his book by emphasizing that these tips can and should be customized and incorporated into each organization's software development projects, always bearing in mind the criteria for maintainable software.In summary, this book serves as an insightful guide on constructing maintainable software, replete with valuable hints, guidelines, and code examples. Although the code examples are written in Java + Spring, they are straightforward and can be understood by anyone familiar with object-oriented programming languages. Moreover, even non-native English speakers will find the author's explanations easy to comprehend.
Amazon Verified review Amazon
Thomas W. Jul 31, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book gives you very practical but technology agnostic insights on the Hexagonal Architecture style.I especially liked the discussion on shortcuts and tradeoffs on the different aspects which comes with this architectural style.What I especially liked about the second version of the book are the cross references to maintainability at the end of each chapter. I also find the thoughts on horizontal / vertical layering in chapter 13 very insightful and practical relevant.At the very end the author present a very pragmatic architecture style to enable high modularity in software systems with less complex domain and how to evolve it over time -> this was my personal highlight.What I personally missed are some concrete examples about:* Approaches when integrating multiple external systems in an asynchronous manner (especially on the API design of ports) -> command/query vs reactive* Usage of domain events for cross domain communication, but also reporting purposes* Approaches on how to share some common technical aspects (aka shared kernel) between/inside domains / components (there is always some common code ;-))* How to make modularity measurable -> which metrics would you apply and have been proven as practical relevantBut all in all this is by far the best practical lecture on how to structure code in a modular manner which I have read so far !Following the authors guidelines will enable you to transform your legacy software architecture into an evolutionary one :-)
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.