分离和重构大量依赖类的最佳方法
我有大量的分层结构(或 DTO),它们在不同的业务逻辑、应用程序层、Web 服务和 WCF 合约之间共享。 我想重构我的所有代码,将结构拆分为离散的业务领域区域。
两个问题:
是否有任何工具可以帮助我做到这一点(假设我想要 A 类,列出所有依赖项)?
是否有必要在不同的应用程序域中复制 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:
Are there any tools that can help me do this (given that I want class A, list all of the dependencies)?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
关于数字2:
当然,有界上下文: http://dddcommunity.org/discussion/messageboardarchive/BoundedContext.html
查看这篇文章以更好地理解它: http: //devlicio.us/blogs/casey/archive/2009/02/11/ddd-bounded-contexts.aspx
对于 1 号 Resharper :)
Regarding number 2:
sure, bounded context: http://dddcommunity.org/discussion/messageboardarchive/BoundedContext.html
check this post to understand it better: http://devlicio.us/blogs/casey/archive/2009/02/11/ddd-bounded-contexts.aspx
For number 1 Resharper :)
Resharper/CodeRush 可以帮助解决问题#1。它们都对重构有很好的支持。
Resharper/CodeRush can help with question# 1. They both have good support for refactoring.
http://www.jetbrains.com/resharper/features/code_refactoring.html#重命名
http://www.jetbrains.com/resharper/features/code_refactoring.html#Rename
我将从 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.
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