Domain-Driven Design with Java

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Description Adopt a practical and modern approach to architecting and implementing DDD-inspired solutions to transform abstract business ideas into working software across the entire spectrum of the software development life cycle Key Features: Implement DDD principles to build simple, effective, and well-factored solutions Use lightweight modeling techniques to arrive at a common collective understanding of the problem domain Decompose monolithic applications into loosely coupled, distributed components using modern design patterns Book Description: Domain-Driven Design (DDD) makes available a set of techniques and patterns that enable domain experts, architects, and developers to work together to decompose complex business problems into a set of well-factored, collaborating, and loosely coupled subsystems. This practical guide will help you as a developer and architect to put your knowledge to work in order to create elegant software designs that are enjoyable to work with and easy to reason about. You'll begin with an introduction to the concepts of domain-driven design and discover various ways to apply them in real-world scenarios. You'll also appreciate how DDD is extremely relevant when creating cloud native solutions that employ modern techniques such as event-driven microservices and fine-grained architectures. As you advance through the chapters, you'll get acquainted with core DDD's strategic design concepts such as the ubiquitous language, context maps, bounded contexts, and tactical design elements like aggregates and domain models and events. You'll understand how to apply modern, lightweight modeling techniques such as business value canvas, Wardley mapping, domain storytelling, and event storming, while also learning how to test-drive the system to create solutions that exhibit high degrees of internal quality. By the end of this software design book, you'll be able to architect, design, and implement robust, resilient, and performant distributed software solutions. What You Will Learn: Discover how to develop a shared understanding of the problem domain Establish a clear demarcation between core and peripheral systems Identify how to evolve and decompose complex systems into well-factored components Apply elaboration techniques like domain storytelling and event storming Implement EDA, CQRS, event sourcing, and much more Design an ecosystem of cohesive, loosely coupled, and distributed microservices Test-drive the implementation of an event-driven system in Java Grasp how non-functional requirements influence bounded context decompositions Who this book is for: This book is for intermediate Java programmers looking to upgrade their software engineering skills and adopt a collaborative and structured approach to designing complex software systems. Specifically, the book will assist senior developers and hands-on architects to gain a deeper understanding of domain-driven design and implement it in their organization. Familiarity with DDD techniques is not a prerequisite; however, working knowledge of Java is expected.

Author(s): Karthik Krishnan, Premanand Chandraseka
Edition: 1
Publisher: Packt
Year: 2022

Language: English
Pages: 302
Tags: java 17 openjdk web apps platform independant machine learning neural android

Cover
Copyright
Contributors
Table of Contents
Preface
Part 1: Foundations
Chapter 1: The Rationale for Domain-Driven Design
Why do software projects fail?
Inaccurate requirements
Too much architecture
Too little architecture
Excessive incidental complexity
Uncontrolled technical debt
Ignoring non-functional requirements
Modern systems and dealing with complexity
How software gets built
Complexity is inevitable
Optimizing the feedback loop
What is DDD?
Understanding the problem using strategic design
Promoting a shared understanding using a ubiquitous language
Implementing the solution using tactical design
Why is DDD relevant? Why now?
Rise of open source
Advances in technology
Rise of distributed computing
Summary
Further reading
Chapter 2: Where and How Does DDD Fit?
Architecture styles
Layered architecture
Vertical slice architecture
Service-oriented architecture (SOA)
Microservices architecture
Event-driven architecture (EDA)
Command Query Responsibility Segregation (CQRS)
Serverless architecture
The big ball of mud
Which architecture style should you use?
Programming paradigms
Object-oriented programming
Functional programming
Which paradigm should you choose?
Summary
Part 2: Real-World DDD
Chapter 3: Understanding the Domain
The domain of international trade
International trade at KP Bank
Understanding international trade strategy at KP Bank
The business model canvas
The lean canvas
Impact maps
Wardley maps
International trade products and services
Summary
Further reading
Chapter 4: Domain Analysis and Modeling
Technical requirements
Understanding a letter of credit
An LC issuance application
Enhancing shared understanding
Domain storytelling
Using DST for an LC application
EventStorming
Introducing EventStorming
Using EventStorming for the LC issuance application
Summary
Further reading
Chapter 5: Implementing Domain Logic
Technical requirements
Continuing our design journey
Implementing the command side
Tooling choices
Bootstrapping the application
Identifying commands
Identifying aggregates
Test-driving the system
Implementing the command
Implementing the event
Designing the aggregate
Persisting aggregates
State-stored aggregates
Event-sourced aggregates
Persistence technology choices
Which persistence mechanism should we choose?
Enforcing policies
Summary
Further reading
Chapter 6: Implementing the User Interface – Task-Based
Technical requirements
API styles
CRUD-based APIs
Task-based APIs
Task-based or CRUD-based?
Bootstrapping the UI
Implementing the UI
MVVM primer
Creating a new LC
Declarative view
View delegate
View-model
Summary
Further reading
Chapter 7: Implementing Queries
Technical requirements
Continuing our design journey
Implementing the query side
Tooling choices
Identifying queries
Creating the query model
Query-side persistence choices
Exposing a query API
Advanced query scenarios
Historic event replays
Types of replays
Event replay considerations
Event design
Event handlers with side effects
Summary
Further reading
Chapter 8: Implementing Long-Running Workflows
Technical requirements
Continuing our design journey
Implementing sagas
Orchestration
Choreography
Handling deadlines
Summary
Further reading
Chapter 9: Integrating with External Systems
Continuing our design journey
Bounded context relationships
Symmetric relationship patterns
Asymmetric relationship patterns
Implementation patterns
Data-based
Code-based
IPC-based
Summary
Further reading
Part 3: Evolution Patterns
Chapter 10: Beginning the Decomposition Journey
Continuing our design journey
Decomposing our monolith
Changes to frontend interactions
Protocol options
Transport format
Compatibility and versioning
REST APIs
Changes for event interactions
Changes in database interactions
Data migration
Cut-over
Summary
References
Chapter 11: Decomposing into Finer-Grained Components
Continuing our design journey
Saga as a standalone component
Commands and queries as standalone components
Distributing individual query components
Even more fine-grained decomposition
Effects on the domain model
Decomposing the frontend
Where to draw the line
Team organization
Summary
Further reading
Chapter 12: Beyond Functional Requirements
Observability
Technology metrics
Business metrics
DevOps metrics
Consistency
Performance and scale
Trunk-based development
Continuous testing
Contract testing
Mutation testing
Chaos testing
Deployment automation
Refactoring
Breaking an existing monolith
Merging into coarse-grained bounded contexts
Invocation style
Synchronous invocation
Asynchronous invocation
Logging
Segregating logging code
Dealing with sensitive data
Log format
Log aggregation
Tracing
Versioning
Components
APIs
Data
Summary
Closing thoughts
Index
Other Books You May Enjoy