← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 1971.o.1.b.1.a.2.c.1.a.1.c.4

防腐层支持旧系统渐进接替

理解等级:高级

原书的货运系统教学方案先做最小新应用:本地 Shipment 对象经防腐层译成旧系统预订请求,旧系统确认再译回新模型对象。这样新应用可主要按自己的模型演进,同时保留旧系统可用能力。

后续版本可逐步接管旧功能,或只在旧系统旁增添新价值;隔离层提供这种选择空间,但翻译开发和维护有成本。若大量核心语义都需向外部模型靠拢,应重新比较顺从者模式或适度调整本地模型,不能为了隔离而无限加码。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第14章|Anticorruption Layer · 查看原书依据

      Initially, the ANTICORRUPTION LAYER will accept the objects representing a shipment, convert them, pass them to the legacy system and request a booking, and then capture the confirmation and translate it back into the confirmation object of the new design. This isolation will allow us to develop our new application mostly independently of the old one, though we'll have to invest quite a bit in translation.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第109章《Anticorruption Layer》(源文件:_epub-src/0321125215_ch14lev1sec8.html;单元04) - 结论依据:原文给出货运系统新旧模型之间双向翻译、分批发布的例子,并明确隔离的费用与灵活性。 - 原始内容:Initially, the ANTICORRUPTION LAYER will accept the objects representing a shipment, convert them, pass them to the legacy system and request a booking, and then capture the confirmation and translate it back into the confirmation object of the new design. This isolation will allow us to develop our new application mostly independently of the old one, though we'll have to invest quite a bit in translation.