分离和重构大量依赖类的最佳方法

发布于 2024-07-14 18:12:21 字数 245 浏览 4 评论 0原文

我有大量的分层结构(或 DTO),它们在不同的业务逻辑、应用程序层、Web 服务和 WCF 合约之间共享。 我想重构我的所有代码,将结构拆分为离散的业务领域区域。

两个问题:

  1. 是否有任何工具可以帮助我做到这一点(假设我想要 A 类,列出所有依赖项)?

  2. 是否有必要在不同的应用程序域中复制 DTO 以允许它们独立发展? 固定规范业务模型的想法纯粹是虚构的!

I have a v-large number of hierarchical structures (or DTO's) that are shared across different business logic, application tiers, web service and WCF contracts. I want to refactor all of my code to split the structures into discreet business domain areas.

Two questions:

  1. Are there any tools that can help me do this (given that I want class A, list all of the dependencies)?

  2. Is there a case for duplicating DTO's in different application domains to allow them to evolve independently? The idea of a fixed Canonical Business Model is pure fiction!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

终陌 2024-07-21 18:12:21

Resharper/CodeRush 可以帮助解决问题#1。它们都对重构有很好的支持。

Resharper/CodeRush can help with question# 1. They both have good support for refactoring.

無心 2024-07-21 18:12:21

我将从 NDepend 分析开始,列出依赖项(请参阅这篇文章:控制组件依赖关系以获得更清晰的架构

然后我将使用 Resharper 来简化重构。

祝你好运。

I'll start with NDepend analysis to list dependencies (see this article : Control Component Dependencies to gain cleaner architecture)

And then I'll use Resharper to ease the refactoring.

Good luck.

败给现实 2024-07-21 18:12:21

Structure 101(非免费)(www.structural101.com/) 和/或 Code Navigator(免费)(http://plugins.intellij.net/plugin/?id=3202)可能有用

Structure 101 (not free)(www.structure101.com/) and/or Code Navigator (free) (http://plugins.intellij.net/plugin/?id=3202) might be useful

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文