烂翻译系列之学习领域驱动设计——结束语

To complete our exploration of domain-driven design I want to get back to the quote we started with:

为了完成我们对领域驱动设计的探讨,我想回到我们开始时引用的那句话:

       There is no sense in talking about the solution before we agree on the problem, and no sense talking about the implementation steps before we agree on the solution.    在我们就问题达成一致之前讨论解决方案是没有意义的,在我们就解决方案达成一致之前讨论执行步骤也是没有意义的。

       —Efrat Goldratt-Ashlag

This quote neatly summarizes our DDD journey.

这句话很好地概括了我们的DDD之旅。

Problem

(须解决的)问题

To provide a software solution, we first have to understand the problem: what is the business domain that we are working in, what are the business goals, and what is the strategy for achieving them.

为了提供软件解决方案,我们首先需要理解问题:我们正在处理的业务领域是什么,业务目标是什么,以及实现这些目标的策略是什么。

We used the ubiquitous language to gain a deep understanding of the business domain and its logic that we have to implement in software.

我们使用通用语言来深入了解业务领域及其逻辑,以便在软件中实现它们。

You learned to manage the complexity of the business problem by breaking it apart into bounded contexts. Each bounded context implements a single model of the business domain, aimed at solving a specific problem.

您学会了通过将业务问题分解为有界上下文来管理业务问题的复杂性。每个有界上下文实现业务领域的一个单一模型,目的是解决特定的问题。

We discussed how to identify and categorize the building blocks of business domains: core, supporting, and generic subdomains. Table E-1 compares these three types of subdomains.

我们讨论了如何识别和分类业务领域的构建块: 核心子域、支撑子域和通用子域。表 E-1比较了这三种类型的子域。

Table E-1. The three types of subdomains

表 E-1.  三种类型的子域

Subdomain type    子域类型 Competitive advantage    竞争优势 Complexity    复杂度 Volatility    波动性 Implementation    实现 Problem    问题
Core    核心子域 Yes High High In-house    内部实现 Interesting
Generic    通用子域 No High Low Buy/adopt    购买/采用 Solved
Supporting    支撑子域 No Low Low In-house/outsource    内部或外包 Obvious

Solution

解决方案

You learned to leverage this knowledge to design solutions optimized for each type of subdomain. We discussed four business logic implementation patterns—transaction script, active record, domain model, and event sourced domain model—and the scenarios in which each pattern shines. You also saw three architectural patterns that provide the required scaffolding for the implementation of business logic: layered architecture, ports & adapters, and CQRS. Figure E-1 summarizes the heuristics for tactical decision-making using these patterns.

您学会了如何利用这些知识来设计针对每种类型子域优化的解决方案。我们讨论了四种业务逻辑实现模式——事务脚本、活动记录、领域模型和事件源领域模型,以及每种模式适用的场景。您还看到了三种架构模式,它们为业务逻辑的实现提供了必要的支撑:分层架构、端口和适配器以及CQRS。图E-1总结了使用这些模式进行战术决策的启示。

Figure E-1. Decision tree summarizing heuristics for tactical decision-making

图 E-1.  决策树总结了战术决策的启示

Implementation

实现

In Part III, we discussed how to turn theory into practice. You learned how to effectively build a ubiquitous language by facilitating an EventStorming session, how to keep the design in shape as the business domain evolves, and how to introduce and start using domain-driven design in brownfield projects.

在第三部分,我们讨论了如何将理论付诸实践。你学会了如何通过组织一次事件风暴研讨会来有效地构建一种通用语言,如何随着业务领域的演变来保持设计的完整性,以及如何在现有项目中引入并开始使用领域驱动设计。

In Part IV, we discussed the interplay between domain-driven design and other methodologies and patterns: microservices, event-driven architecture, and data mesh. We saw that not only can DDD be used in tandem with these techniques, but they in fact complement each other.

在第四部分,我们讨论了领域驱动设计与其他方法和模式(微服务、事件驱动架构和数据网格)之间的相互作用。我们发现,领域驱动设计不仅可以与这些技术结合使用,而且它们实际上相辅相成。

Further Reading

延伸阅读

I hope this book got you interested in domain-driven design. If you want to keep learning, here are some books that I wholeheartedly recommend.

我希望这本书能让你对领域驱动设计产生兴趣。如果你想继续学习,以下是我真心推荐的几本书。

Advanced Domain-Driven Design

高级领域驱动设计

  • Evans, E. (2003). Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley.  Eric Evans’s original book that introduced the domain-driven design methodology. Although it doesn’t reflect newer aspects of DDD such as domain events and event sourcing, it’s still essential reading for becoming a DDD black belt.    Evans, E. (2003).《领域驱动设计:软件核心复杂性应对之道》。波士顿:艾迪生-维斯利出版社。这是Eric Evans介绍领域驱动设计方法论的原著。尽管它没有反映DDD的较新方面,如领域事件和事件溯源,但对于成为DDD领域的佼佼者来说,它仍然是必读之作。
  • Martraire, C. (2019). Living Documentation: Continuous Knowledge Sharing by Design. Boston: Addison-Wesley.  In this book, Cyrille Martraire proposes a domain-driven design–based approach to knowledge sharing, documentation, and testing.    Martraire, C. (2019).《活的文档:通过设计实现持续知识共享》。波士顿:艾迪生-维斯利出版社。在这本书中,Cyrille Martraire提出了一种基于领域驱动设计的知识共享、文档编写和测试方法。
  • Vernon, V. (2013). Implementing Domain-Driven Design. Boston: Addison-Wesley.   Another timeless DDD classic. Vaughn Vernon provides in-depth discussion and detailed examples of domain-driven design thinking and the use of its strategic and tactical toolset. As a learning foundation, Vaughn uses a real-world example of failing initiatives with DDD and the teams’ rejuvenated journey afforded by applying essential course corrections.    Vernon, V. (2013).《实现领域驱动设计》。波士顿:艾迪生-维斯利出版社。这是另一本不朽的DDD经典之作。Vaughn Vernon对领域驱动设计的思维方式和其战略与战术工具集的使用进行了深入讨论,并提供了详细的例子。作为学习基础,Vaughn使用了一个现实世界中的例子,即失败的DDD项目以及团队在应用关键课程修正后重获新生的历程。
  • Young, G. (2017). Versioning in an Event Sourced System. Leanpub.  In Chapter 7, we discussed that it can be challenging to evolve an event-sourced system. This book is dedicated to this topic.    Young, G. (2017).《事件溯源系统中的版本控制》。Leanpub。在第7章中,我们讨论了演化一个事件溯源系统可能具有挑战性。这本书专门讨论了这个话题。

Architectural and Integration Patterns

架构和集成模式

  • Dehghani, Z. (Expected to be published in 2022). Data Mesh: Delivering Data-Driven Value at Scale. Boston: O’Reilly.  Zhamak Dehghani is the author of the data mesh pattern that we discussed in Chapter 16. In this book, Dehghani explains the principles behind the data management architecture, as well as how to implement the data mesh architecture in practice.    Dehghani, Z.(预计将于2022年出版)。《数据网格:实现大规模数据驱动价值》。波士顿:O’Reilly。Zhamak Dehghani是我们在第16章中讨论的数据网格模式的作者。在这本书中,Dehghani解释了数据管理架构背后的原则,以及如何在实践中实现数据网格架构。
  • Fowler, M. (2002). Patterns of Enterprise Application Architecture. Boston: Addison-Wesley.   The classic application architecture patterns book that I quoted multiple times in Chapter 5 and Chapter 6. This is the book in which the transaction script, active record, and domain model patterns were originally defined.    Fowler, M. (2002).《企业应用架构模式》。波士顿:艾迪生-维斯利出版社。这是我在第5章和第6章中多次引用的经典应用架构模式书籍。在这本书中,最早定义了事务脚本、活动记录和领域模型模式。
  • Hohpe, G., & Woolf, B. (2003). Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions. Boston: Addison-Wesley.   Many of the patterns discussed in Chapter 9 were originally introduced in this book. Read this book for more component integration patterns.    Hohpe, G.,& Woolf, B. (2003).《企业集成模式:设计、构建和部署消息传递解决方案》。波士顿:艾迪生-维斯利出版社。第9章中讨论的许多模式最初都是在这本书中引入的。阅读这本书可以了解更多组件集成模式。
  • Richardson, C. (2019). Microservice Patterns: With Examples in Java. New York: Manning Publications.   In this book, Chris Richardson provides many detailed examples of patterns often used when architecting microservices-based solutions. Among the discussed patterns are saga, process manager, and outbox, which we discussed in Chapter 9.    Richardson, C. (2019).《微服务模式:Java实例》。纽约:Manning Publications。在这本书中,Chris Richardson提供了许多详细示例,这些示例展示了在构建基于微服务的解决方案时经常使用的模式。其中讨论的模式包括我们在第9章中讨论的saga(长事务)、流程管理器和发件箱模式。

Modernization of Legacy Systems

遗留系统现代化

  • Kaiser, S. (Expected to be published in 2022). Adaptive Systems with Domain-Driven Design, Wardley Mapping, and Team Topologies. Boston: Addison-Wesley.   Susanne Kaiser shares her experience of modernizing legacy systems by leveraging domain-driven design, Wardley mapping, and team topologies.    Kaiser, S.(预计将于2022年出版)。《使用领域驱动设计、Wardley映射和团队拓扑构建自适应系统》。波士顿:艾迪生-维斯利出版社。Susanne Kaiser分享了她在利用领域驱动设计、Wardley映射和团队拓扑来现代化遗留系统方面的经验。
  • Tune, N. (Expected to be published in 2022). Architecture Modernization: Product, Domain, & Team Oriented. Leanpub.   In this book, Nick Tune discusses in depth how to leverage domain-driven design and other techniques to modernize brownfield projects’ architecture.    架构现代化:以产品、领域和团队为导向》。Leanpub。在这本书中,Nick Tune深入探讨了如何利用领域驱动设计和其他技术来现代化遗留项目的架构。
  • Vernon, V., & Jaskula, T. (2021). Implementing Strategic Monoliths and Microservices. Boston: Addison-Wesley.   A hands-on book in which the authors demonstrate ageless software engineering tools, including rapid discovery and learning, domain-driven approaches, and handling the intricacies of properly implementing monolith- and microservices-based solutions, all while focusing on the most important aspect: delivering innovative business strategy.    Vernon, V., & Jaskula, T. (2021).《实现战略单体和微服务》。波士顿:艾迪生-维斯利出版社。这是一本实操性很强的书籍,作者展示了永恒的软件工程工具,包括快速发现和学习、领域驱动的方法,以及处理正确实现基于单体和微服务的解决方案的复杂性,同时关注最重要的方面:实现创新的业务战略。
  • Vernon, V., & Jaskula, T. (2021). Strategic Monoliths and Microservices. Boston: Addison-Wesley.   In this book Vaughn and Tomasz promote software strategic thinking by exploring how to achieve all-important innovations using discovery-based learning along with a domain-driven approach, and how to select the most purposeful architecture and tools for the job: microservices, monoliths, or a blend, and how to make them work together.    Vernon, V., & Jaskula, T. (2021).《战略单体和微服务》。波士顿:艾迪生-维斯利出版社。在这本书中,Vaughn和Tomasz通过探索如何使用基于发现的学习方法和领域驱动方法来实现至关重要的创新,以及如何选择最适合工作的架构和工具(微服务、单体或混合架构),并如何使它们协同工作,来推广软件战略思维。

EventStorming

事件风暴

  • Brandolini, A. (Not yet published). Introducing EventStorming. Leanpub.   Alberto Brandolini is the creator of the EventStorming workshop, and in this book, he explains in detail the process and rationale behind EventStorming.    Brandolini, A.(尚未出版)。《事件风暴介绍》。Leanpub。Alberto Brandolini是事件风暴研讨会的创始人,在这本书中,他详细介绍了事件风暴的过程和背后的原理。
  • Rayner, P. (Not yet published). The EventStorming Handbook. Leanpub.   Paul Rayner explains how he uses EventStorming in practice, including numerous tips and tricks for facilitating a successful session.    Rayner, P.(尚未出版)。《事件风暴手册》。Leanpub。Paul Rayner解释了他在实践中如何使用事件风暴,包括许多关于如何促进研讨会成功的技巧和窍门。

Conclusion

总结

That’s it! Thank you so much for reading this book. I hope you enjoyed it and that you will use what you’ve learned from it.

就是这样!非常感谢你读了这本书。我希望你们喜欢它,并且会用到你们从中学到的东西。

What I hope you take away from this book are the logic and the principles behind domain-driven design tools. Don’t follow domain-driven design blindly as a dogma, but rather understand the reasoning it is based on. This understanding will significantly increase your opportunities to apply DDD and gain value from it. Understanding the philosophy of domain-driven design is also the key to leveraging value by incorporating the methodology’s concepts individually, especially in brownfield projects.

我希望您从这本书中学到的是领域驱动设计工具背后的逻辑和原则。不要盲目地将领域驱动设计视为教条,而是要理解它所基于的推理。这种理解将大大增加您应用DDD并从中获得价值的机会。理解领域驱动设计的哲学思想,也是通过单独融入该方法论中的各个概念来创造价值的关键,尤其是在遗留项目中。

Finally, always watch your ubiquitous language, and when in doubt, do EventStorming. Good luck!

最后,请始终关注您的通用语言,如有疑问,请进行事件风暴。祝您好运!

posted @ 2023-05-13 11:16  菜鸟吊思  阅读(69)  评论(0)    收藏  举报