architecture - DDD,反腐败层,如何做?

标签 architecture domain-driven-design rewrite legacy

目前,我们必须构建一个基于遗留应用程序的应用程序。旧应用程序的代码应该被丢弃并重写,但通常情况下 - 我们不需要重写它,而是需要在它的基础上添加一些新的东西。最近,我们决定走 DomainDrivenDesign 路径。所以——反腐败层可以解决我们的问题。据我了解,这种方式应该可以逐步重写旧应用程序。

但是——我找不到任何好的例子。我将不胜感激 任何信息。

最佳答案

来自 DDD book (Domain-Driven Design: Tackling Complexity in the Heart of Software)通过埃里克埃文斯:

The public interface of the ANTICORRUPTION LAYER usually appears as a set of SERVICES, although occasionally it can take the form of an ENTITY.



稍后

One way of organizing the design of the ANTICORRUPTION LAYER is as a combination of FACADES, ADAPTERS (both from Gamma et al. 1995), and translators, along with the communication and transport mechanisms usually needed to talk between systems.



因此,您可以通过查看建议的 adapter pattern 来找到示例。和 facade pattern .

我将尝试解释 Eric Evans 所说的话,您的反腐败层将作为服务出现在您的层之外。因此,在反腐败层之外,其他层将不知道他们正在与反腐败层“说话”。在该层内部,您将使用适配器和外观来包装您的遗留信息源。

有关反腐败层的更多信息:
  • Anatomy of an Anti-Corruption Layer, Part 1
  • Building the often needed anti-corruption layer
  • 关于architecture - DDD,反腐败层,如何做?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/909264/

    相关文章:

    php - 如何配置 nginx 重写规则以使 CakePHP 在 CentOS 上运行?

    Nginx 重写语法

    model-view-controller - Qt 流程图应用架构

    .net - 动态业务规则的架构

    c# - 在 C# 中使用引用项目引用的类型

    java - 从 DDD 后的应用程序批量导出时的最佳实践是什么

    domain-driven-design - 不禁将域实体视为浪费。为什么?

    html - 理解单类/多类模式

    c# - 我应该在 DDD 中执行多少实体和值对象的概念?

    iis - 在 IIS8.5 中设置 MaxWebConfigFileSizeInKB