Designing Hexagonal Architecture with Java: An architect's guide to building maintainable and change-tolerant applications with Java and Quarkus

Davi Vieira

  • 出版商: Packt Publishing
  • 出版日期: 2022-01-07
  • 售價: $1,680
  • 貴賓價: 9.5$1,596
  • 語言: 英文
  • 頁數: 460
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1801816484
  • ISBN-13: 9781801816489
  • 相關分類: Java 程式語言
  • 立即出貨 (庫存=1)

買這商品的人也買了...

商品描述

A practical guide for software architects and Java developers to build cloud-native hexagonal applications using Java and Quarkus to create systems that are easier to refactor, scale, and maintain

Key Features

  • Learn techniques to decouple business and technology code in an application
  • Apply hexagonal architecture principles to produce more organized, coherent, and maintainable software
  • Minimize technical debts and tackle complexities derived from multiple teams dealing with the same code base

Book Description

Hexagonal architecture enhances developers' productivity by decoupling business code from technology code, making the software more change-tolerant, and allowing it to evolve and incorporate new technologies without the need for significant refactoring. By adhering to hexagonal principles, you can structure your software in a way that reduces the effort required to understand and maintain the code.

This book starts with an in-depth analysis of hexagonal architecture's building blocks, such as entities, use cases, ports, and adapters. You'll learn how to assemble business code in the Domain hexagon, create features by using ports and use cases in the Application hexagon, and make your software compatible with different technologies by employing adapters in the Framework hexagon. Moving on, you'll get your hands dirty developing a system based on a real-world scenario applying all the hexagonal architecture's building blocks. By creating a hexagonal system, you'll also understand how you can use Java modules to reinforce dependency inversion and ensure the isolation of each hexagon in the architecture. Finally, you'll get to grips with using Quarkus to turn your hexagonal application into a cloud-native system.

By the end of this hexagonal architecture book, you'll be able to bring order and sanity to the development of complex and long-lasting applications.

What you will learn

  • Find out how to assemble business rules algorithms using the specification design pattern
  • Combine domain-driven design techniques with hexagonal principles to create powerful domain models
  • Employ adapters to make the system support different protocols such as REST, gRPC, and WebSocket
  • Create a module and package structure based on hexagonal principles
  • Use Java modules to enforce dependency inversion and ensure isolation between software components
  • Implement Quarkus DI to manage the life cycle of input and output ports

Who this book is for

This book is for software architects and Java developers who want to improve code maintainability and enhance productivity with an architecture that allows changes in technology without compromising business logic, which is precisely what hexagonal architecture does. Intermediate knowledge of the Java programming language and familiarity with Jakarta EE will help you to get the most out of this book.

商品描述(中文翻譯)

一本實用指南,針對軟體架構師和Java開發人員,使用Java和Quarkus建立雲原生六邊形應用程式,以創建更容易重構、擴展和維護的系統。

主要特點:
- 學習在應用程式中解耦業務和技術代碼的技術
- 應用六邊形架構原則,產生更有組織、一致和易於維護的軟體
- 減少技術債務,解決多個團隊處理相同程式碼庫所帶來的複雜性

書籍描述:
六邊形架構通過將業務代碼與技術代碼解耦,提高開發人員的生產力,使軟體更具變動容忍性,並允許其在不需要大規模重構的情況下演進和融入新技術。通過遵循六邊形原則,您可以以降低理解和維護程式碼所需的工作量的方式結構化軟體。

本書從深入分析六邊形架構的構建塊開始,例如實體、用例、端口和適配器。您將學習如何在領域六邊形中組合業務代碼,使用端口和用例在應用程式六邊形中創建功能,並通過在框架六邊形中使用適配器使軟體與不同技術兼容。接下來,您將親自開發一個基於真實場景的系統,應用所有六邊形架構的構建塊。通過創建一個六邊形系統,您還將了解如何使用Java模組來加強依賴反轉,並確保架構中每個六邊形的隔離。最後,您將學習如何使用Quarkus將您的六邊形應用程式轉變為雲原生系統。

通過閱讀本書,您將能夠為開發複雜且持久的應用程式帶來秩序和理智。

學到的內容:
- 了解如何使用規格設計模式組合業務規則算法
- 結合領域驅動設計技術和六邊形原則,創建強大的領域模型
- 使用適配器使系統支援REST、gRPC和WebSocket等不同協議
- 基於六邊形原則創建模組和封裝結構
- 使用Java模組強制執行依賴反轉,確保軟體組件之間的隔離
- 實現Quarkus DI來管理輸入和輸出端口的生命週期

適合閱讀對象:
本書適合軟體架構師和Java開發人員,他們希望通過一種允許在不影響業務邏輯的情況下改變技術的架構來提高程式碼的可維護性和生產力。具備中級Java編程語言知識和熟悉Jakarta EE將有助於您充分利用本書的內容。

作者簡介

Davi Vieira is a software craftsman with a vested interest in the challenges faced by large enterprises in software design, development, and architecture. He has more than 10 years of experience constructing and maintaining complex, long-lasting, and mission-critical systems using object-oriented languages. He values the good lessons and the software development tradition left by others who came before him. Inspired by this software tradition, he develops and evolves his ideas.

作者簡介(中文翻譯)

Davi Vieira 是一位軟體工匠,對大型企業在軟體設計、開發和架構方面所面臨的挑戰有著濃厚的興趣。他擁有超過10年的經驗,使用面向對象的語言構建和維護複雜、持久和關鍵的系統。他重視他人留下的良好教訓和軟體開發傳統。受到這種軟體傳統的啟發,他不斷發展和演進自己的想法。

目錄大綱

Table of Contents

  1. Why Hexagonal Architecture?
  2. Wrapping Business Rules inside Domain Hexagon
  3. Handling Behavior with Ports and Use Cases
  4. Creating Adapters to Interact with the Outside World
  5. Exploring the Nature of Driving and Driven Operations
  6. Building the Domain Hexagon
  7. Building the Application Hexagon
  8. Building the Framework Hexagon
  9. Applying Dependency Inversion with Java Modules
  10. Adding Quarkus to a Modularized Hexagonal Application
  11. Leveraging CDI Beans to Manage Ports and Use Cases
  12. Using RESTEasy Reactive to Implement Input Adapters
  13. Persisting Data with Output Adapters and Hibernate Reactive
  14. Setting Up Dockerfile and Kubernetes Objects for Cloud Deployment
  15. Good Design Practices for Your Hexagonal Application

目錄大綱(中文翻譯)

目錄

1. 為什麼要使用六邊形架構?
2. 在領域六邊形中封裝業務規則
3. 使用端口和用例處理行為
4. 創建與外部世界互動的適配器
5. 探索驅動和被驅動操作的本質
6. 構建領域六邊形
7. 構建應用程序六邊形
8. 構建框架六邊形
9. 使用Java模塊應用依賴反轉
10. 將Quarkus添加到模塊化的六邊形應用程序
11. 利用CDI Beans管理端口和用例
12. 使用RESTEasy Reactive實現輸入適配器
13. 使用輸出適配器和Hibernate Reactive持久化數據
14. 為雲端部署設置Dockerfile和Kubernetes對象
15. 六邊形應用程序的良好設計實踐