目 錄 Part I Putting the Domain Model to Work / 運(yùn)用領(lǐng)域模型 1 Chapter 1: Crunching Knowledge / 消化知識(shí) 7 Ingredients of Effective Modeling / 有效建模的要素 12 Knowledge Crunching / 知識(shí)消化 13 Continuous Learning / 持續(xù)學(xué)習(xí) 15 Knowledge-Rich Design / 知識(shí)豐富的設(shè)計(jì) 17 Deep Models / 深層模型 20 Chapter 2: Communication and the Use of Language / 交流與語(yǔ)言的使用 23 UBIQUITOUS LANGUAGE 24 Modeling Out Loud /“大聲地”建?!?0 One Team, One Language / 一個(gè)團(tuán)隊(duì),一種語(yǔ)言 32 Documents and Diagrams / 文檔和圖 35 Written Design Documents / 書面設(shè)計(jì)文檔 37 Executable Bedrock / 完全依賴可執(zhí)行代碼的情況 40 Explanatory Models / 解釋性模型 41 Chapter 3: Binding Model and Implementation / 綁定模型和實(shí)現(xiàn) 45 MODEL-DRIVEN DESIGN 47 Modeling Paradigms and Tool Support / 建模范式和工具支持 50 Letting the Bones Show: Why Models Matter to Users / 揭示主旨:為什么模型對(duì)用戶至關(guān)重要 57 HANDS-ON MODELERS 60 Part II The Building Blocks of a Model-Driven Design / 模型驅(qū)動(dòng)設(shè)計(jì)的構(gòu)造塊 63 Chapter 4: Isolating the Domain / 分離領(lǐng)域 67 LAYERED ARCHITECTURE 68 Relating the Layers / 將各層關(guān)聯(lián)起來(lái) 72 Architectural Frameworks / 架構(gòu)框架 74 The Domain Layer Is Where the Model Lives / 領(lǐng)域?qū)邮悄P偷木琛?5 THE SMART UI “ANTI-PATTERN” / THE SMART UI“反模式” 76 Other Kinds of Isolation / 其他分離方式 79 Chapter 5: A Model Expressed in Software / 軟件中所表示的模型 81 Associations / 關(guān)聯(lián) 82 ENTITIES(A.K.A. REFERENCE OBJECTS)/ ENTITY(也稱為REFERENCE OBJECT) 89 Modeling ENTITIES / ENTITY建?!?3 Designing the Identity Operation / 設(shè)計(jì)標(biāo)識(shí)操作 94 VALUE OBJECTS 97 Designing VALUE OBJECTS / 設(shè)計(jì)VALUE OBJECT 99 Designing Associations That Involve VALUE OBJECTS / 設(shè)計(jì)包含VALUE OBJECT的關(guān)聯(lián) 102 SERVICES 104 SERVICES and the Isolated Domain Layer / SERVICE與孤立的領(lǐng)域?qū)印?06 Granularity / 粒度 108 Access to SERVICES / 對(duì)SERVICE的訪問(wèn) 108 MODULES(A.K.A. PACKAGES)/ MODULE(也稱為PACKAGE) 109 Agile MODULES / 敏捷的MODULE 111 The Pitfalls of Infrastructure-Driven Packaging / 通過(guò)基礎(chǔ)設(shè)施打包時(shí)存在的隱患 112 Modeling Paradigms / 建模范式 116 Why the Object Paradigm Predominates / 對(duì)象范式流行的原因 116 Nonobjects in an Object World / 對(duì)象世界中的非對(duì)象 119 Sticking with MODEL-DRIVEN DESIGN When Mixing Paradigms /在混合范式中堅(jiān)持使用MODEL-DRIVEN DESIGN 120 Chapter 6: The Life Cycle of a Domain Object / 領(lǐng)域?qū)ο蟮纳芷凇?23 AGGREGATES 125 FACTORIES 136 Choosing FACTORIES and Their Sites / 選擇FACTORY及其應(yīng)用位置 139 When a Constructor Is All You Need / 有些情況下只需使用構(gòu)造函數(shù) 141 Designing the Interface / 接口的設(shè)計(jì) 143 Where Does Invariant Logic Go / 固定規(guī)則的相關(guān)邏輯應(yīng)放置在哪里 144 ENTITY FACTORIES Versus VALUE OBJECT FACTORIES / ENTITY FACTORY與VALUE OBJECT FACTORY 144 Reconstituting Stored Objects / 重建已存儲(chǔ)的對(duì)象 145 REPOSITORIES 147 Querying a REPOSITORY / REPOSITORY的查詢 152 Client Code Ignores REPOSITORY Implementation; Developers Do Not / 客戶代碼可以忽略REPOSITORY的實(shí)現(xiàn),但開發(fā)人員不能忽略 154 Implementing a REPOSITORY / REPOSITORY的實(shí)現(xiàn) 155 Working Within Your Frameworks / 在框架內(nèi)工作 156 The Relationship with FACTORIES / 與FACTORY的關(guān)系 157 Designing Objects for Relational Databases / 為關(guān)系數(shù)據(jù)庫(kù)設(shè)計(jì)對(duì)象 159 Chapter 7: Using the Language: An Extended Example / 使用語(yǔ)言:一個(gè)擴(kuò)展的示例 163 Introducing the Cargo Shipping System / 貨物運(yùn)輸系統(tǒng)簡(jiǎn)介 163 Isolating the Domain: Introducing the Applications / 隔離領(lǐng)域:引入應(yīng)用層 166 Distinguishing ENTITIES and VALUE OBJECTS / 將ENTITY和VALUE OBJECT區(qū)別開 167 Designing Associations in the Shipping Domain / 設(shè)計(jì)運(yùn)輸領(lǐng)域中的關(guān)聯(lián) 169 AGGREGATE Boundaries / AGGREGATE邊界 170 Selecting REPOSITORIES / 選擇REPOSITORY 172 Walking Through Scenarios / 場(chǎng)景走查 173 Sample Application Feature: Changing the Destination of a Cargo / 應(yīng)用程序特性舉例:更改Cargo的目的地 173 Sample Application Feature: Repeat Business / 應(yīng)用程序特性舉例:重復(fù)業(yè)務(wù) 173 Object Creation / 對(duì)象的創(chuàng)建 174 FACTORIES and Constructors for Cargo / Cargo的FACTORY和構(gòu)造函數(shù) 174 Adding a Handling Event / 添加Handling Event 175 Pause for Refactoring: An Alternative Design of the Cargo AGGREGATE / 停一下,重構(gòu):Cargo AGGREGATE 的另一種設(shè)計(jì) 177 MODULES in the Shipping Model / 運(yùn)輸模型中的MODULE 179 Introducing a New Feature: Allocation Checking / 引入新特性:配額檢查 181 Connecting the Two Systems / 連接兩個(gè)系統(tǒng) 182 Enhancing the Model: Segmenting the Business / 進(jìn)一步完善模型:劃分業(yè)務(wù) 183 Performance Tuning / 性能優(yōu)化 185 A Final Look / 小結(jié) 186 Part III Refactoring Toward Deeper Insight / 通過(guò)重構(gòu)來(lái)加深理解 187 Chapter 8: Breakthrough / 突破 193 Story of a Breakthrough / 一個(gè)關(guān)于突破的故事 194 A Decent Model, and Yet . . . / 華而不實(shí)的模型 194 The Breakthrough / 突破 196 A Deeper Model / 更深層模型 198 A Sobering Decision / 冷靜決策 199 The Payoff / 成果 200 Opportunities / 機(jī)遇 201 Focus on Basics / 關(guān)注根本 201 Epilogue: A Cascade of New Insights / 后記:越來(lái)越多的新理解 202 Chapter 9: Making Implicit Concepts Explicit / 將隱式概念轉(zhuǎn)變?yōu)轱@式概念 205 Digging Out Concepts / 概念挖掘 206 Listen to Language / 傾聽語(yǔ)言 206 Scrutinize Awkwardness / 檢查不足之處 210 Contemplate Contradictions / 思考矛盾之處 216 Read the Book / 查閱書籍 217 Try, Try Again / 嘗試,再嘗試 219 How to Model Less Obvious Kinds of Concepts / 如何為那些不太明顯的概念建?!?19 Explicit Constraints / 顯式的約束 220 Processes as Domain Objects / 將過(guò)程建模為領(lǐng)域?qū)ο蟆?22 SPECIFICATION 224 Applying and Implementing SPECIFICATION / SPECIFICATION的應(yīng)用和實(shí)現(xiàn) 227 Chapter 10: Supple Design / 柔性設(shè)計(jì) 243 INTENTION-REVEALING INTERFACES 246 SIDE-EFFECT-FREE FUNCTIONS 250 ASSERTIONS 255 CONCEPTUAL CONTOURS 260 STANDALONE CLASSES 265 CLOSURE OF OPERATIONS 268 Declarative Design / 聲明式設(shè)計(jì) 270 A Declarative Style of Design / 聲明式設(shè)計(jì)風(fēng)格 273 Angles of Attack / 切入問(wèn)題的角度 282 Carve Off Subdomains / 分割子領(lǐng)域 283 Draw on Established Formalisms, When You Can / 盡可能利用已有的形式 283 Chapter 11: Applying Analysis Patterns / 應(yīng)用分析模式 293 Chapter 12: Relating Design Patterns to the Model / 將設(shè)計(jì)模式應(yīng)用于模型 309 STRATEGY (A.K.A. POLICY) / STRATEGY(也稱為POLICY) 311 COMPOSITE 315 Why Not FLYWEIGHT / 為什么沒(méi)有介紹FLYWEIGHT 320 Chapter 13: Refactoring Toward Deeper Insight / 通過(guò)重構(gòu)得到更深層的理解 321 Initiation / 開始重構(gòu) 321 Exploration Teams / 探索團(tuán)隊(duì) 322 Prior Art / 借鑒先前的經(jīng)驗(yàn) 323 A Design for Developers / 針對(duì)開發(fā)人員的設(shè)計(jì) 324 Timing / 重構(gòu)的時(shí)機(jī) 324 Crisis as Opportunity / 危機(jī)就是機(jī)遇 325 Part IV Strategic Design / 戰(zhàn)略設(shè)計(jì) 327 Chapter 14: Maintaining Model Integrity / 保持模型的完整性 331 BOUNDED CONTEXT 335 CONTINUOUS INTEGRATION 341 CONTEXT MAP 344 Testing at the CONTEXT Boundaries / 測(cè)試CONTEXT的邊界 351 Organizing and Documenting CONTEXT MAPS / CONTEXT MAP的組織和文檔化 351 Relationships Between BOUNDED CONTEXTS / BOUNDED CONTEXT之間的關(guān)系 352 SHARED KERNEL 354 CUSTOMER/SUPPLIER DEVELOPMENT TEAMS 356 CONFORMIST 361 ANTICORRUPTION LAYER 364 Designing the Interface of the ANTICORRUPTION LAYER / 設(shè)計(jì)ANTICORRUPTION LAYER的接口 366 Implementing the ANTICORRUPTION LAYER / 實(shí)現(xiàn)ANTICORRUPTION LAYER 366 A Cautionary Tale / 一個(gè)關(guān)于防御的故事 370 SEPARATE WAYS 371 OPEN HOST SERVICE 374 PUBLISHED LANGUAGE 375 Unifying an Elephant /“大象”的統(tǒng)一 378 Choosing Your Model Context Strategy / 選擇你的模型上下文策略 381 Team Decision or Higher / 團(tuán)隊(duì)決策或更高層決策 382 Putting Ourselves in Context / 置身上下文中 382 Transforming Boundaries / 轉(zhuǎn)換邊界 382 Accepting That Which We Cannot Change: Delineating the External Systems / 接受那些我們無(wú)法更改的事物:描述外部系統(tǒng) 383 Relationships with the External Systems / 與外部系統(tǒng)的關(guān)系 384 The System Under Design / 設(shè)計(jì)中的系統(tǒng) 385 Catering to Special Needs with Distinct Models / 用不同模型滿足特殊需要 386 Deployment / 部署 387 The Trade-off / 權(quán)衡 388 When Your Project Is Already Under Way / 當(dāng)項(xiàng)目正在進(jìn)行時(shí) 388 Transformations / 轉(zhuǎn)換 389 Merging CONTEXTS: SEPARATE WAYS SHARED KERNEL / 合并CONTEXT:SEPARATE WAY → SHARED KERNEL 389 Merging CONTEXTS: SHARED KERNEL CONTINUOUS INTEGRATION / 合并CONTEXT:SHARED KERNEL → CONTINUOUS INTEGRATION 391 Phasing Out a Legacy System / 逐步淘汰遺留系統(tǒng) 393 OPEN HOST SERVICE → PUBLISHED LANGUAGE 394 Chapter 15: Distillation / 精煉 397 CORE DOMAIN 400 Choosing the CORE / 選擇CORE 402 Who Does the Work / 工作的分配 403 An Escalation of Distillations / 精煉的逐步提升 404 GENERIC SUBDOMAINS 406 Generic Doesn’t Mean Reusable / 通用不等于可重用 412 Project Risk Management / 項(xiàng)目風(fēng)險(xiǎn)管理 413 DOMAIN VISION STATEMENT 415 HIGHLIGHTED CORE 417 The Distillation Document / 精煉文檔 418 The Flagged CORE / 標(biāo)明CORE 419 The Distillation Document as Process Tool / 把精煉文檔作為過(guò)程工具 420 COHESIVE MECHANISMS 422 GENERIC SUBDOMAIN Versus COHESIVE MECHANISM / GENERIC SUBDOMAIN與COHESIVE MECHANISM的比較 424 When a MECHANISM Is Part of the CORE DOMAIN / MECHANISM是CORE DOMAIN一部分 425 Distilling to a Declarative Style / 通過(guò)精煉得到聲明式風(fēng)格 426 SEGREGATED CORE 428 The Costs of Creating a SEGREGATED CORE / 創(chuàng)建SEGREGATED CORE的代價(jià) 429 Evolving Team Decision / 不斷發(fā)展演變的團(tuán)隊(duì)決策 430 ABSTRACT CORE 435 Deep Models Distill / 深層模型精煉 436 Choosing Refactoring Targets / 選擇重構(gòu)目標(biāo) 437 Chapter 16: Large-Scale Structure / 大型結(jié)構(gòu) 439 EVOLVING ORDER 444 SYSTEM METAPHOR 447 RESPONSIBILITY LAYERS 450 KNOWLEDGE LEVEL 465 PLUGGABLE COMPONENT FRAMEWORK 475 How Restrictive Should a Structure Be / 結(jié)構(gòu)應(yīng)該有一種什么樣的約束 480 Refactoring Toward a Fitting Structure / 通過(guò)重構(gòu)得到更適當(dāng)?shù)慕Y(jié)構(gòu) 481 Minimalism / 最小化 481 Communication and Self-Discipline / 溝通和自律 482 Restructuring Yields Supple Design / 通過(guò)重構(gòu)得到柔性設(shè)計(jì) 482 Distillation Lightens the Load / 通過(guò)精煉可以減輕負(fù)擔(dān) 483 Chapter 17: Bringing the Strategy Together / 領(lǐng)域驅(qū)動(dòng)設(shè)計(jì)的綜合運(yùn)用 485 Combining Large-Scale Structures and BOUNDED CONTEXTS / 把大型結(jié)構(gòu)與BOUNDED CONTEXT結(jié)合起來(lái)使用 485 Combining Large-Scale Structures and Distillation / 將大型結(jié)構(gòu)與精煉結(jié)合起來(lái)使用 488 Assessment First / 首先評(píng)估 490 Who Sets the Strategy / 由誰(shuí)制定策略 490 Emergent Structure from Application Development / 從應(yīng)用程序開發(fā)自動(dòng)得出的結(jié)構(gòu) 491 A Customer-Focused Architecture Team / 以客戶為中心的架構(gòu)團(tuán)隊(duì) 492 Six Essentials for Strategic Design Decision Making / 制定戰(zhàn)略設(shè)計(jì)決策的6個(gè)要點(diǎn) 492 The Same Goes for the Technical Frameworks / 技術(shù)框架同樣如此 495 Beware the Master Plan / 注意總體規(guī)劃 496 Conclusion / 結(jié)束語(yǔ) 499 Appendix: The Use of Patterns in This Book / 附錄:本書中模式的使用 507 Glossary / 術(shù)語(yǔ)表 511 References / 參考文獻(xiàn) 515 Photo Credits / 圖片說(shuō)明 517