Home  >  Article  >  What are the criteria that should be followed for module division in software design?

What are the criteria that should be followed for module division in software design?

尚
Original
2020-04-20 14:13:5615788browse

What are the criteria that should be followed for module division in software design?

#The principle that should be followed in module division in software design is high cohesion and low coupling.

High cohesion and low coupling is a concept in software engineering. It is a standard for judging the quality of software design. It is mainly used in the object-oriented design of programs. It mainly depends on whether the cohesion of the class is high. , whether the coupling degree is low.

In software design, coupling and cohesion are usually used as standards to measure the degree of module independence. One criterion for dividing modules is high cohesion and low coupling.

From the perspective of module granularity, high cohesion: as much as possible, each member method of the class only completes one thing (maximum aggregation); low coupling: reduce the number of members within the class that one member method calls another member method.

From a class perspective, high cohesion and low coupling: reduce calls to other classes within the class; from a functional block perspective, high cohesion and low coupling: reduce the interaction complexity between modules (number of interfaces , parameter data) that is, horizontally: between classes and between modules and modules; vertically: between levels; as much as possible, content is cohesive and data is coupled.

The above is the detailed content of What are the criteria that should be followed for module division in software design?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn