Book description
Gain insight into how hexagonal architecture can help to keep the cost of development low over the complete lifetime of an application
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 building maintainable solutions instead of taking shortcuts
Book Description
We would all like to build software architecture that yields adaptable and flexible software with low development costs. But, unreasonable deadlines and shortcuts make it very hard to create such an architecture.
Get Your Hands Dirty on Clean Architecture starts with a discussion about the conventional layered architecture style and its disadvantages. It also talks about the advantages of the domain-centric architecture styles of 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. You'll also learn what shortcuts produce what types of technical debt and how, sometimes, it is a good idea to willingly take on those debts.
After reading this book, you'll have all the knowledge you need to create applications using the hexagonal architecture style of web development.
What you will learn
- Identify potential shortcomings of using a layered architecture
- Apply methods to enforce architecture boundaries
- Find out how potential shortcuts can affect the software architecture
- Produce arguments for when to use which style of architecture
- Structure your code according to the architecture
- Apply various types of tests that will cover 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
- Preface
- Chapter 1
- What's Wrong with Layers?
- Chapter 2
- Inverting Dependencies
- Chapter 3
- Organizing Code
- Chapter 4
-
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 5
- Implementing a Web Adapter
- Chapter 6
- Implementing a Persistence Adapter
- Chapter 7
-
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 8
- Mapping Between Boundaries
- Chapter 9
- Assembling the Application
- Chapter 10
- Enforcing Architecture Boundaries
- Chapter 11
- Taking Shortcuts Consciously
- Chapter 12
- Deciding on an Architecture Style
Product information
- Title: Get Your Hands Dirty on Clean Architecture
- Author(s):
- Release date: September 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839211966
You might also like
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Software Architecture for Busy Developers
A quick start guide to learning essential software architecture tools, frameworks, design patterns, and best practices …
book
Designing Event-Driven Systems
Many forces affect software today: larger datasets, geographical disparities, complex company structures, and the growing need …
book
Effective Java, 3rd Edition
Since this Jolt-award winning classic was last updated in 2008, the Java programming environment has changed …