High polymerization, low coupling

xiaoxiao2021-03-06  21

I saw an introduction today and talked about cohesiveness and coupling. I have never really studied these two terms, and I will learn again today.

"Module independence refers to each module completely completes the independent subsidians required by the system, and with other modules, the interface is simple, two qualitative metrics - coupling and cohesiveness. Coupleability is also known as blocks Refers to a metric of each module interconnected in each module in the software system structure. The closer connection between the modules, the stronger the coupling, the worse the independence of the module. The degree of coupling between the modules depends on the inter-module inter-interface. Complexity, calling method and delivery information. No direct coupling; data coupling; marking coupling; control coupling; common coupling; content coupling (low - high); 2 Data coupling refers to between two modules There is a call relationship, passed is a simple data value, which is equivalent to the value transfer of the advanced language; 3 mark coupling refers to the data structure between the two modules, such as the array name, record name, file name, etc. in the advanced language. The name is tag, actually transmitted the address of this data structure; 4 When the connection is a module to call another module, the control variable (such as switches, signs, etc.) is transmitted, and the value of the modular module passes the value of the control variable. Execute the block in the block. 5 Public coupling refers to the coupling between the modules interacting through a public data environment. The common coupled complex program increases with the number of coupling modules. 6 Content coupling: this is the highest degree The coupling is also the worst coupled. When a module directly uses the internal data of another module, or transfer to the other module inside it through a non-normal entry. The cohesiveness is also related to the block of the module. Measurement of functional strength of the module That is, the tightness of the individual elements in one module is combined with each other. If each element (between the numerals, the block is between the blocks, the block is between the blocks, the higher its cohesiveness. Casual internal gather Logical internal poly; time cohesion; communication internal poly; sequential cohesion; functional internal poly (low - high) 1 occasionally incorporated between various processing elements in one module. 2 logical integer module Performed several logical similar functions, determine which function is made by parameter. 3 time Gather: Module that is combined together to be formed simultaneously into a time consolidation module. 4 Internal Finger module within the communication All processing elements operate on the same data structure (sometimes called information), or refer to each process using the same input data or generates the same output data. 5 sequentially intended into each processing element in one module. Related to the same function and must be executed sequentially, the previous function element output is the input of the next functional element. 6 Functional internal gather: This is the strongest consolidation, all elements in the mesh, complete a function, and it is not possible. The coupling of other modules is the weakest. Coupleability and cohesiveness are two qualitative criteria for module independence. When the software system is divided, try to achieve high-internal phenomenal coupling, improve the independence of the module. Quality software structure laying the foundation. "

The word "coupling" was first listened by primary school. When the radio circuit was self-study, it was understood that two components such as coils, and inductors. Later, I saw this word in the software engineering. The software engineering is old, "high-poly, low coupling, but there is no really understanding at that time. There is an example to understand: A process has 50 functions, this The program is implemented very well; however, once you modify one of the functions, the other 49 functions need to be modified, this is the consequence of high coupling. Once you understand it, you will design a class or module when you write a profile design. "High Poly, low coupling".

转载请注明原文地址:https://www.9cbs.com/read-41469.html

New Post(0)