

Learning Domain-Driven Design (ebook)



Learning Domain-Driven Design (ebook) - Najlepsze oferty
Learning Domain-Driven Design (ebook) - Opis
Building software is harder than ever. As a developer, you not only have to chase ever-changing technological trends but also need to understand the business domains behind the software. This practical book provides you with a set of core patterns, principles, and practices for analyzing business domains, understanding business strategy, and, most importantly, aligning software design with its business needs.Author Vlad Khononov shows you how these practices lead to robust implementation of business logic and help to future-proof software design and architecture. You'll examine the relationship between domain-driven design (DDD) and other methodologies to ensure you make architectural decisions that meet business requirements. You'll also explore the real-life story of implementing DDD in a startup company.With this book, you'll learn how to:Analyze a company's business domain to learn how the system you're building fits its competitive strategyUse DDD's strategic and tactical tools to architect effective software solutions that address business needsBuild a shared understanding of the business domains you encounterDecompose a system into bounded contextsCoordinate the work of multiple teamsGradually introduce DDD to brownfield projects Spis treści:Foreword
Preface
Why I Wrote This Book
Who Should Read This Book
Navigating the Book
Example Domain: WolfDesk
Conventions Used in This Book
Using Code Examples
OReilly Online Learning
How to Contact Us
Acknowledgments
Introduction
I. Strategic Design
1. Analyzing Business (...) więcej Domains
What Is a Business Domain?
What Is a Subdomain?
Types of Subdomains
Core subdomains
Complexity
Sources of competitive advantage
Generic subdomains
Supporting subdomains
Comparing Subdomains
Competitive advantage
Complexity
Volatility
Solution strategy
Identifying Subdomain Boundaries
Distilling subdomains
Subdomains as coherent use cases
Focus on the essentials
Domain Analysis Examples
Gigmaster
Business domain and subdomains
Core subdomains
Generic subdomains
Supporting subdomains
Design decisions
BusVNext
Business domain and subdomains
Core subdomains
Generic subdomains
Supporting subdomains
Design decisions
Who Are the Domain Experts?
Conclusion
Exercises
2. Discovering Domain Knowledge
Business Problems
Knowledge Discovery
Communication
What Is a Ubiquitous Language?
Language of the Business
Scenarios
Consistency
Ambiguous terms
Synonymous terms
Model of the Business Domain
What Is a Model?
Effective Modeling
Modeling the Business Domain
Continuous Effort
Tools
Challenges
Conclusion
Exercises
3. Managing Domain Complexity
Inconsistent Models
What Is a Bounded Context?
Model Boundaries
Ubiquitous Language Refined
Scope of a Bounded Context
Bounded Contexts Versus Subdomains
Subdomains
Bounded Contexts
The Interplay Between Subdomains and Bounded Contexts
Boundaries
Physical Boundaries
Ownership Boundaries
Bounded Contexts in Real Life
Semantic Domains
Science
Buying a Refrigerator
Conclusion
Exercises
4. Integrating Bounded Contexts
Cooperation
Partnership
Shared Kernel
Shared scope
Implementation
When to use shared kernel
CustomerSupplier
Conformist
Anticorruption Layer
Open-Host Service
Separate Ways
Communication Issues
Generic Subdomains
Model Differences
Context Map
Maintenance
Limitations
Conclusion
Exercises
II. Tactical Design
5. Implementing Simple Business Logic
Transaction Script
Implementation
Its Not That Easy!
Lack of transactional behavior
Distributed transactions
Implicit distributed transactions
When to Use Transaction Script
Active Record
Implementation
When to Use Active Record
Be Pragmatic
Conclusion
Exercises
6. Tackling Complex Business Logic
History
Domain Model
Implementation
Complexity
Ubiquitous language
Building Blocks
Value object
Ubiquitous language
Implementation
When to use value objects
Entities
Aggregates
Consistency enforcement
Transaction boundary
Hierarchy of entities
Referencing other aggregates
The aggregate root
Domain events
Ubiquitous language
Domain services
Managing Complexity
Conclusion
Exercises
7. Modeling the Dimension of Time
Event Sourcing
Search
Analysis
Source of Truth
Event Store
Event-Sourced Domain Model
Advantages
Disadvantages
Frequently Asked Questions
Performance
Deleting Data
Why Cant I Just?
Conclusion
Exercises
8. Architectural Patterns
Business Logic Versus Architectural Patterns
Layered Architecture
Presentation Layer
Business Logic Layer
Data Access Layer
Communication Between Layers
Variation
Service layer
Terminology
When to Use Layered Architecture
Ports & Adapters
Terminology
Dependency Inversion Principle
Integration of Infrastructural Components
Variants
When to Use Ports & Adapters
Command-Query Responsibility Segregation
Polyglot Modeling
Implementation
Command execution model
Read models (projections)
Projecting Read Models
Synchronous projections
Asynchronous projections
Challenges
Model Segregation
When to Use CQRS
Scope
Conclusion
Exercises
9. Communication Patterns
Model Translation
Stateless Model Translation
Synchronous
Asynchronous
Stateful Model Translation
Aggregating incoming data
Unifying multiple sources
Integrating Aggregates
Outbox
Fetching unpublished events
Saga
Consistency
Process Manager
Conclusion
Exercises
III. Applying Domain-Driven Design in Practice
10. Design Heuristics
Heuristic
Bounded Contexts
Business Logic Implementation Patterns
Architectural Patterns
Testing Strategy
Testing Pyramid
Testing Diamond
Reversed Testing Pyramid
Tactical Design Decision Tree
Conclusion
Exercises
11. Evolving Design Decisions
Changes in Domains
Core to Generic
Generic to Core
Supporting to Generic
Supporting to Core
Core to Supporting
Generic to Supporting
Strategic Design Concerns
Tactical Design Concerns
Transaction Script to Active Record
Active Record to Domain Model
Domain Model to Event-Sourced Domain Model
Generating Past Transitions
Modeling Migration Events
Organizational Changes
Partnership to CustomerSupplier
CustomerSupplier to Separate Ways
Domain Knowledge
Growth
Subdomains
Bounded Contexts
Aggregates
Conclusion
Exercises
12. EventStorming
What Is EventStorming?
Who Should Participate in EventStorming?
What Do You Need for EventStorming?
The EventStorming Process
Step 1: Unstructured Exploration
Step 2: Timelines
Step 3: Pain Points
Step 4: Pivotal Events
Step 5: Commands
Step 6: Policies
Step 7: Read Models
Step 8: External Systems
Step 9: Aggregates
Step 10: Bounded Contexts
Variants
When to Use EventStorming
Facilitation Tips
Watch the Dynamics
Remote EventStorming
Conclusion
Exercises
13. Domain-Driven Design in the Real World
Strategic Analysis
Understand the Business Domain
Core subdomains
Generic subdomains
Supporting subdomains
Explore the Current Design
Evaluate the tactical design
Evaluate the strategic design
Modernization Strategy
Strategic Modernization
Tactical Modernization
Cultivate a Ubiquitous Language
Strangler pattern
Refactoring tactical design decisions
Pragmatic Domain-Driven Design
Selling Domain-Driven Design
Undercover Domain-Driven Design
Ubiquitous language
Bounded contexts
Tactical design decisions
Event-sourced domain model
Conclusion
Exercises
IV. Relationships to Other Methodologies and Patterns
14. Microservices
What Is a Service?
What Is a Microservice?
Method as a Service: Perfect Microservices?
Design Goal
System Complexity
Microservices as Deep Services
Microservices as Deep Modules
Domain-Driven Design and Microservices Boundaries
Bounded Contexts
Aggregates
Subdomains
Compressing Microservices Public Interfaces
Open-Host Service
Anticorruption Layer
Conclusion
Exercises
15. Event-Driven Architecture
Event-Driven Architecture
Events
Events, Commands, and Messages
Structure
Types of Events
Event notification
Security
Concurrency
Event-carried state transfer
Domain event
Domain events versus event notification
Domain events versus event-carried state transfer
Event types: Example
Designing Event-Driven Integration
Distributed Big Ball of Mud
Temporal Coupling
Functional Coupling
Implementation Coupling
Refactoring the Event-Driven Integration
Event-Driven Design Heuristics
Assume the worst
Use public and private events
Evaluate consistency requirements
Conclusion
Exercises
16. Data Mesh
Analytical Data Model Versus Transactional Data Model
Fact Table
Dimension Table
Analytical Models
Analytical Data Management Platforms
Data Warehouse
Data Lake
Challenges of Data Warehouse and Data Lake Architectures
Data Mesh
Decompose Data Around Domains
Data as a Product
Enable Autonomy
Build an Ecosystem
Combining Data Mesh and Domain-Driven Design
Conclusion
Exercises
Closing Words
Problem
Solution
Implementation
Further Reading
Advanced Domain-Driven Design
Architectural and Integration Patterns
Modernization of Legacy Systems
EventStorming
Conclusion
A. Applying DDD: A Case Study
Five Bounded Contexts
Business Domain
Bounded Context #1: Marketing
A kind of magic
Our early understanding of domain-driven design
Bounded Context #2: CRM
More aggregates!
Solution design: Take two
Tower of Babel 2.0
A broader understanding of domain-driven design
Bounded Context #3: Event Crunchers
Bounded Context #4: Bonuses
Design: Take two
Ubiquitous language
A classic understanding of domain-driven design
Bounded Context #5: The Marketing Hub
Micro what?
The real problem
Discussion
Ubiquitous Language
Subdomains
Mapping design decisions to subdomains
Dont ignore pain
Boundaries of Bounded Contexts
Conclusion
B. Answers to Exercise Questions
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
References
Index O autorze: Vladik (Vlad) Khononov jest inżynierem oprogramowania od ponad 15 lat. Specjalizuje się w projektowaniu dziedzinowym dla firm z wielu branż i chętnie dzieli się swoim bogatym doświadczeniem. Często występuje podczas branżowych konferencji, takich jak O’Reilly Software Architecture, DDD Europe i NDC, a także działa na rzecz grup Domain-Driven Design Israel i Tel Aviv Software Architecture. Mieszka w północnym Izraelu z żoną i (prawie) rozsądną liczbą kotów. mniej
Learning Domain-Driven Design (ebook) - Opinie i recenzje
Na liście znajdują się opinie, które zostały zweryfikowane (potwierdzone zakupem) i oznaczone są one zielonym znakiem Zaufanych Opinii. Opinie niezweryfikowane nie posiadają wskazanego oznaczenia.