Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Designing Hexagonal Architecture with Java

You're reading from  Designing Hexagonal Architecture with Java

Product type Book
Published in Jan 2022
Publisher Packt
ISBN-13 9781801816489
Pages 460 pages
Edition 1st Edition
Languages
Author (1):
Davi Vieira Davi Vieira
Profile icon Davi Vieira
Toc

Table of Contents (21) Chapters close

Preface 1. Section 1: Architecture Fundamentals
2. Chapter 1: Why Hexagonal Architecture? 3. Chapter 2: Wrapping Business Rules inside Domain Hexagon 4. Chapter 3: Handling Behavior with Ports and Use Cases 5. Chapter 4: Creating Adapters to Interact with the Outside World 6. Chapter 5: Exploring the Nature of Driving and Driven Operations 7. Section 2: Using Hexagons to Create a Solid Foundation
8. Chapter 6: Building the Domain Hexagon 9. Chapter 7: Building the Application Hexagon 10. Chapter 8: Building the Framework Hexagon 11. Chapter 9: Applying Dependency Inversion with Java Modules 12. Section 3: Becoming Cloud-Native
13. Chapter 10: Adding Quarkus to a Modularized Hexagonal Application 14. Chapter 11: Leveraging CDI Beans to Manage Ports and Use Cases 15. Chapter 12: Using RESTEasy Reactive to Implement Input Adapters 16. Chapter 13: Persisting Data with Output Adapters and Hibernate Reactive 17. Chapter 14: Setting Up Dockerfile and Kubernetes Objects for Cloud Deployment 18. Chapter 15: Good Design Practices for Your Hexagonal Application 19. Assessments 20. Other Books You May Enjoy

Chapter 9: Applying Dependency Inversion with Java Modules

In the previous chapters, we learned how to develop each hexagon as a Java module. By doing that, we started to enforce the scope and responsibilities of each hexagon in the architecture. But we did not go too far in exploiting the Java module's features, such as encapsulation and dependency inversion, and how these features can enhance the overall structure of a hexagonal system by making it more robust and loosely coupled.

To understand the role that's played by the Java Platform Module System (JPMS) in developing a hexagonal system, we need to understand what problems JPMS aims to solve. Once we know what we can do with JPMS in terms of encapsulation and dependency inversion, we can apply these techniques in conjunction with the hexagonal architecture.

So, in this chapter, we will learn how to combine JPMS with the hexagonal architecture to create a well-encapsulated system with clearly defined boundaries...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}