𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Get Your Hands Dirty on Clean Architecture: Build 'clean' applications with code examples in Java, 2nd Edition [Team-IRA]

✍ Scribed by Tom Hombergs


Publisher
Packt Publishing
Year
2023
Tongue
English
Leaves
168
Edition
2
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Gain insight into how Hexagonal Architecture can help to increase maintainability.

Key Features

  • 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

Book 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.

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

Who this book is 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.

Table of Contents

  1. Maintainability
  2. What's Wrong with Layers?
  3. Inverting Dependencies
  4. Organizing Code
  5. Implementing a Use Case
  6. Implementing a Web Adapter
  7. Implementing a Persistence Adapter
  8. Testing Architecture Elements
  9. Mapping between Boundaries
  10. Assembling the Application
  11. Taking Shortcuts Consciously
  12. Enforcing Architecture Boundaries
  13. Managing Multiple Bounded Contexts
  14. A Component-Based Approach to Software Architecture
  15. Deciding on an Architecture Style

✦ Table of Contents


Cover
Title Page
Copyright
Dedication
Foreword
Contributors
Table of Contents
Preface
Chapter 1: Maintainability
What does maintainability even mean?
Maintainability enables functionality
Maintainability generates developer joy
Maintainability supports decision-making
Maintaining maintainability
Chapter 2: What’s Wrong with Layers?
They promote database-driven design
They’re prone to shortcuts
They grow hard to test
They hide the use cases
They make parallel work difficult
How does this help me build maintainable software?
Chapter 3: Inverting Dependencies
The Single Responsibility Principle
A tale about side effects
The Dependency Inversion Principle
Clean Architecture
Hexagonal Architecture
How does this help me build maintainable software?
Chapter 4: Organizing Code
Organizing By Layer
Organizing by feature
An architecturally expressive package structure
The role of dependency injection
How does this help me build maintainable software?
Chapter 5: Implementing a Use Case
Implementing the domain model
A use case in a nutshell
Validating input
The power of constructors
Different input models for different use cases
Validating business rules
Rich versus anemic domain model
Different output models for different use cases
What about read-only use cases?
How does this help me build maintainable software?
Chapter 6: Implementing a Web Adapter
Dependency Inversion
Responsibilities of a web adapter
Slicing controllers
How does this help me build maintainable software?
Chapter 7: Implementing a Persistence Adapter
Dependency inversion
Responsibilities of a persistence adapter
Slicing port interfaces
Slicing persistence adapters
An example with Spring Data JPA
What about database transactions?
How does this help me build maintainable software?
Chapter 8: Testing Architecture Elements
The test pyramid
Testing a domain entity with unit tests
Testing a use case with unit tests
Testing a web adapter with integration tests
Testing a persistence adapter with integration tests
Testing main paths with system tests
How much testing is enough?
How does this help me build maintainable software?
Chapter 9: Mapping between Boundaries
The β€œNo Mapping” strategy
The β€œTwo-Way” mapping strategy
The β€œFull” mapping strategy
The β€œOne-Way” mapping strategy
When to use which mapping strategy?
How does this help me build maintainable software?
Chapter 10: Assembling the Application
Why even care about assembly?
Assembling via plain code
Assembling via Spring’s classpath scanning
Assembling via Spring’s Java Config
How does this help me build maintainable software?
Chapter 11: Taking Shortcuts Consciously
Why shortcuts are like broken windows
The responsibility of starting clean
Sharing models between use cases
Using domain entities as the input or output model
Skipping incoming ports
Skipping services
How does this help me build maintainable software?
Chapter 12: Enforcing Architecture Boundaries
Boundaries and dependencies
Visibility modifiers
Post-compile fitness function
Build artifacts
How does this help me build maintainable software?
Chapter 13: Managing Multiple Bounded Contexts
One hexagon per bounded context?
Decoupled bounded contexts
Appropriately coupled bounded contexts
How does this help me build maintainable software?
Chapter 14: A Component-Based Approach to Software Architecture
Modularity through components
Case study – building a β€œCheck Engine” component
Enforcing component boundaries
How does this help me build maintainable software?
Chapter 15: Deciding on an Architecture Style
Start simple
Evolve the domain
Trust your experience
It depends
Index
About Packt
Other Books You May Enjoy


πŸ“œ SIMILAR VOLUMES


Get Your Hands Dirty on Clean Architectu
✍ Tom Hombergs πŸ“‚ Library πŸ“… 2023 πŸ› Packt Publishing 🌐 English

<p><span>Gain insight into how Hexagonal Architecture can help to increase maintainability.</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Explore ways to make your software flexible, extensible, and adaptable</span></span></li><li><span><span>Learn new concepts that you can easily

Get Your Hands Dirty on Clean Architectu
✍ Tom Hombergs πŸ“‚ Library πŸ“… 2019 πŸ› Leanpub 🌐 English

A good software architecture should keep the cost of development low over the complete lifetime of an application. This book discusses how the Hexagonal Architecture style tries to fulfill this goal and translates the concepts into actual code to provide inspiration for software developers.

The Shred Power Cleanse: Eat Clean. Get
✍ Ian K. Smith, M.D. πŸ“‚ Library πŸ“… 2015 πŸ› St. Martin's Publishing Group 🌐 English

<p>Dr. Ian is answering Shredder Nation's call for a short-term, fast-acting cleanse that will help you reset and power through to your new weight loss goal!<br><i>The SHRED Power Cleanse</i> takes the classic detox plan to a new level. You won't find any fiberless, anemic juices on this regimen! Dr