[英]Can someone show me what a good dependency matrix looks like and specify why?
I would like to start using DSM, but not sure how to get started. 我想开始使用DSM,但不知道如何开始使用。
What does a good dependency matrix look like and why? 良好的依赖矩阵是什么样的?为什么? How does it work?
它是如何工作的?
On this blog post Identify Code Structure Patterns with No Effort it is explained how to use a Dependency Structure Matrix to identify Code Structure Patterns. 在此博客文章“ 识别没有努力的代码结构模式”中,解释了如何使用依赖性结构矩阵来识别代码结构模式。 The screenshots are done with the Dependency Structure Matrix of the tool NDepend.
屏幕截图使用工具NDepend的依赖关系结构矩阵完成。 Here are a few patterns:
以下是一些模式:
Layered code (code with no cycle, certainly the coolest thing that a DSM can show you at a glance) 分层代码(没有循环的代码,当然是DSM一眼就能看到的最酷的东西)
Code with dependency cycles 具有依赖循环的代码
High Cohesion / Low-Coupling 高内聚/低耦合
Hungry Caller 饥饿的来电者
Popular Callee 受欢迎的Callee
Mutual Coupling 相互耦合
Data Object 数据对象
Erik Dörnenburg gives the best description I've seen, including some good examples of how arrangements of the graph can expose structural issues. ErikDörnenburg给出了我见过的最好的描述 ,包括一些关于图的排列如何暴露结构问题的好例子。 Briefly:
简述:
List the subsystems on the X and Y axis in the same order. 以相同的顺序列出X轴和Y轴上的子系统。 Mark an "O" diagonally.
对角线标记“O”。 Subsystems depending on themselves doesn't make much sense.
取决于他们自己的子系统没有多大意义。 Go vertically down the matrix.
沿矩阵垂直向下。 If that subsystem depends on the matching horizontal subsystem, mark an X.
如果该子系统依赖于匹配的水平子系统,则标记X.
A good one rearranges the subsystems to show patterns that might lead to a good refactoring. 一个好的人重新安排子系统,以显示可能导致良好重构的模式。
I don't have one handy, though. 不过,我没有一个方便。 Sorry.
抱歉。
One of the most valuable feature of a DSM is to detect cycles, for example between projects or packages. DSM最有价值的功能之一是检测周期,例如项目或包之间的周期。 A cycle is displayed in the top-right side of the matrix.
循环显示在矩阵的右上角。 See this page for more details : http://docs.codehaus.org/display/SONAR/Dependency+Structure+Matrix
有关详细信息,请参阅此页面: http : //docs.codehaus.org/display/SONAR/Dependency+Structure+Matrix
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.