3.2 尽量减少跨模块的依赖关系
FILED IN Erlang-rules No Comments
3.2 Try to reduce intermodule dependencies
inter module :跨模块
dependencies: 依赖关系
3.2 尽量减少跨模块的依赖关系
A module which calls functions in many different modules will be more difficult to maintain than a module which only calls functions in a few different modules.
maintain : 维护 /维持
如果一个模块大量的调用其他外部模块的功能函数,那么它将比那些只调用了少量外部模块功能函数的要难以维护得多。
This is because each time we make a change to a module interface, we have to check all places in the code where this module is called. Reducing the interdependencies between modules simplifies the problem of maintaining these modules.
interdependency:相互依赖性
这是因为每次当我们修改某个模块的接口函数时,我们不得不检查所有调用到这些接口函数的代码。减少模块间的依赖关系,是简化这些模块的维护的一个简单办法。
We can simplify the system structure by reducing the number of different modules which are called from a given module.
我们可以通过减少某个给定的模块调用其他模块的模块数量,来简化我们系统的设计。
Note also that it is desirable that the inter-module calling dependencies form a tree and not a cyclic graph.
desirable:合适的/令人满意的
应当注意的是,假如模块间的调用关系形成一个树状结构,这是允许的,但不要是环形结构。
