您会如何简单地描述 DSM?
您会如何简单地描述 DSM?
How would you describe DSM in simple terms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您会如何简单地描述 DSM?
How would you describe DSM in simple terms?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
简单来说,DSM 是一种与方框和箭头图不同的视觉方式来表示图形。 有趣的是,虽然方框图和箭头图擅长显示具有几十个节点且没有太多连接(稀疏图)的小图,但 DSM 比方框图和箭头图更好箭头图显示更大的图表。 为此,我们称DSM 可扩展。 缺点是 DSM 不像方框和箭头图那样直观,并且有一个学习曲线。
与方框图和箭头图相比,DSM 特别擅长使结构模式变得明显。 具体来说,在这篇博客文章中 一目了然地识别代码结构模式解释了如何使用依赖结构矩阵来识别代码结构模式。 屏幕截图是使用 NDepend 工具的依赖结构矩阵完成的。 以下是一些模式:
分层代码(没有循环的代码,当然是 DSM 可以一目了然地向您展示的最酷的东西)
具有依赖循环的代码
高内聚/低耦合
饥饿的来电
热门被呼叫者
相互耦合
数据对象
In simple terms, a DSM is a different visual way than boxes and arrows diagram to represent a graph. The interesting thing, is that, while boxes and arrows diagrams are good at showing small graphs with a few dozens of node and not too many connections (sparse graph), DSM are better than boxes and arrows diagram at showing larger graph. For that we say that DSM scales. The downside is that DSM is not as intuitive as boxes and arrows diagram and come with a learning curve.
Compare to boxes and arrows diagrams, DSM is especially good to make structural patterns obvious. Concretely, on this blog post Identify Code Structure Patterns at a Glance 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. Here are a few patterns:
Layered code (code with no cycle, certainly the coolest thing that a DSM can show you at a glance)
Code with dependency cycles
High Cohesion / Low-Coupling
Hungry Caller
Popular Callee
Mutual Coupling
Data Object
DSM 背后的基本思想是它以表格形式表示“依赖”或“使用”关系。 帕纳斯定义了A和B之间的“使用”关系,当B“使用”A时,意味着B依赖于A的正确操作来实现自身的正确操作。
使用关系在实际系统中形成一个图。 DSM 是该图的矩阵表示,即所谓的“关联矩阵”,其中每个如果组件之间存在使用关系,则单元格会被标记。 因此,如果 DSM 中有 n 个组件 D,Di,j = 1 iff< /em> j “使用”i。
The basic idea behind a DSM is that it represents the "dependency" or "uses" relationship in a tabular form. Parnas defined the "uses" relation between A and B so that when B "uses" A, it means B depends on A's correct operation for its own correct operation.
The uses relation forms a graph in a real system. The DSM is a matrix representation of that graph, what's called an "incidence matrix", where each cell is marked if there is a uses relation between the components. So if there are n components in a DSM D, Di,j = 1 iff j "uses" i.