Home > other >  High cohesion and low coupling
High cohesion and low coupling

Time:09-17

Coupling: also known as the link between blocks, refers to the software system structure is connected between each module in the degree of one dimension, and the closer connection between modules, the coupling is stronger, the independence of the module is the worse, the coupling between modules depends on the complexity, the module of indirect mouth way of call and message
Cohesion: also called block contact, refers to the function of the module intensity measurement, that is, a module of internal elements combined with each other closely degree of measurement, if each element within a module (between language name, procedures section) the closer contact, the higher is its cohesion,
High cohesion refers to a software module is composed of strong correlation code, only responsible for a task, which is often said that the single responsibility principle,
Coupling: a software structure in different module interconnection between degree of measurement,
For low coupling, superficial understanding is: a complete system, between the modules and modules, as much as possible, make its independent existence, that is to say, let each module, as independent as possible to complete a specific function, the interface between the module and module, as far as possible little and simple, if a relationship between two modules is complicated, it is best to first consider further module partition, so beneficial to modify and combination,
  • Related