简体   繁体   English

有人能告诉我一个好的依赖矩阵是什么样的,并说明原因吗?

[英]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: 简述:

  • as others have mentioned, anything above the diagonal indicates a cycle, which essentially means that your boundaries are "fuzzy" (not clean) 正如其他人所提到的,对角线以上的任何东西都表示一个周期,这实质上意味着你的边界是“模糊的”(不干净)
  • smallish squares (well, lower triangles) along the diagonal == good, if the components are grouped according to hierarchy 如果组件按层次结构分组,则沿对角线的小方块(井,下三角形)== good
  • on the other hand, heavily weighted rows or columns == possible issues: either 另一方面,重量级的行或列==可能的问题:要么
    • rows: you have a component/group that lots of others depend on (maybe it's trying to serve too many features), or 行:你有一个很多其他人依赖的组件/组(可能它试图提供太多的功能),或者
    • columns: you have a component/group that depends on lots of others (maybe it's trying to take care of everything itself, instead of delegating) 列:你有一个组件/组依赖于很多其他组件(可能它试图自己处理所有事情,而不是委托)

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.

相关问题 看起来android studio无法从依赖中找到类 - Looks like android studio can't find classes from dependency 输出不是我期望的。 有人能让我明白为什么会这样吗? - The output isn't what i expected. Can someone make me understand why is so? 谁能告诉我为什么这个if语句总是给我假的? - can someone tell me why this if statement always give me false? classnotfound异常,但一切看起来正确。 有人可以告诉我我的启动功能是否错误? - classnotfound exception but everything looks correct. can someone tell me if my start function is wrong? 有人可以告诉我如何在Eclipse中显示菜单栏吗? - Can someone tell me how to get the menu bar to show in Eclipse? 有人可以向我展示一个简单的 PagerSlidingTabStrip 工作实现吗? - Can someone show me a simple working implementation of PagerSlidingTabStrip? 我无法打印出 0。有人可以告诉我为什么吗? - I can´t print out 0 . Can someone tell me why? 有人能解释一下这个数学方法的作用吗? - Can someone explain me what this math's method does? 谁能告诉我这段代码中的逻辑错误是什么? - Can someone tells me what's the logical error in this code? 有人可以告诉我for循环有什么问题吗 - Can someone please tell me what is wrong with the for loop
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM