Coupling and cohesion

前端 未结 6 560
一生所求
一生所求 2020-12-12 10:31

I\'m trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definiti

6条回答
  •  春和景丽
    2020-12-12 11:21

    Coupling - A measure of how much a module (package, class, method) relies on other modules. It is desirable to reduce coupling, or reduce the amount that a given module relies on the other modules of a system.

    Cohesion - A measure of how closely related the members (classes, methods, functionality within a method) of a module are to the other members of the same module. It is desirable to increase cohesion as that indicates that a module has a very specific task and does only that task.

提交回复
热议问题