Think of efferent coupling as the inverse of afferent coupling.
可以把传出耦合看作传入耦合的逆转。
Afferent coupling is harder to determine and much more valuable.
传入耦合比较难判断,但是更有价值。
Notice the Ca (afferent coupling) metric for this class, which has a value of 3.
注意这个类的Ca(传入耦合)指标,它的值为3。
As with afferent coupling, the abstractness metric comes into play in efferent coupling.
与传入耦合一样,抽象性度量在传出耦合中起作用。
In Figure 1, you can see a package, com.acme.ascp.exception, with an afferent coupling of 4.
在图1中,可以看到一个包com . acme . ascp . exception具有一个值为4的传入耦合。
I'll start out with two of the more interesting coupling metrics, namely afferent coupling and efferent coupling.
我将从两个比较有趣的耦合度量开始,即传入耦合和传出耦合。
You can combine your system's efferent coupling and afferent coupling Numbers to form another metric: instability.
您可以将系统的传出耦合和传入耦合的数量结合起来,形成另一个度量:不稳定性。
This view also shows outgoing calls (efferent coupling) as pink lines and incoming calls (afferent coupling) as red lines.
这个视图还把向外调用(传出耦合)显示为粉红线,把向内调用(传入耦合)显示为红线。
Afferent coupling represents the count of how many other classes reference the current class, via either fields or parameters.
而传入耦合则表示其他类通过字段或参数引用当前类的次数。
For example, in Figure 5, the user package has an instability value of 1, meaning it has an efferent coupling of 4 and no afferent coupling.
例如,在图5中,user包的不稳定性值为1,这表示它有一个值为4的传出耦合,而没有传入耦合。
Core frameworks (like Struts), utilities like logging packages (like log4j), and even exception hierarchies usually have high afferent coupling.
核心框架(如strut)、登录包(如log4j)之类的实用工具以及异常层次结构通常具有高传入耦合。
If afferent coupling is a count of components that depend on a particular component, then efferent coupling is the count of components that a particular component depends on.
如果传入耦合是一些依赖于某个特定组件的组件的话,那么传出耦合则是某个特定组件所依赖的一些组件。
The implications of efferent coupling are similar to those of afferent coupling, with regard to how changes affect code. For example, Figure 4, depicts the com.acme.ascp.dao.
对于更改如何影响代码来说,传出耦合的引号意义与传入耦合的类似。
Because of this responsibility (exposed through a large number of public methods), they're said to have high afferent coupling, which also results in a reversed brittleness.
因为存在这种责任(通过大量public方法导出),所以它们具有高度的输入耦合,也会导致反向的脆弱性。
Just as continuously monitoring afferent coupling can uncover entropy in an architectural design, so monitoring efferent coupling can assist you in spotting unwanted dependencies.
正像连续地监视传入耦合可以揭示架构设计中的熵一样,监视传出耦合也有助于发现不必要的依赖性。
As is true of afferent coupling, the level of dependence isn't a bad thing in and of itself. It's your knowledge of the coupling and how it could affect changes to related components that matters.
重要的是您对耦合的了解以及耦合如何影响对相关组件的更改。
As is true of afferent coupling, the level of dependence isn't a bad thing in and of itself. It's your knowledge of the coupling and how it could affect changes to related components that matters.
重要的是您对耦合的了解以及耦合如何影响对相关组件的更改。
应用推荐