1
1
# Task: 1/2: Cohesion and coupling
2
2
3
- _ ** Cohesion** _ and _ ** coupling** _ are fundamental concepts in software design, which determine how well the components of a
4
- system are organized and how they interact with each other. Move refactorings can play a crucial role in improving
3
+ _ ** Cohesion** _ and _ ** coupling** _ are fundamental concepts in software design that determine how well system components
4
+ are organized and interact with each other. Move refactorings can play a crucial role in improving
5
5
cohesion and reducing coupling within the codebase.
6
6
7
- ** _ Cohesion_ ** refers to how well the parts of a module (such as a class or a function) are related and focused on doing
7
+ ** _ Cohesion_ ** refers to how closely the elements of a module (such as a class or function) are related and focused on doing
8
8
one
9
9
specific job.
10
- ** High cohesion** means that the elements inside the module work closely together and share a common purpose.
11
- On the other hand , ** low cohesion** means that the elements inside the module perform various
10
+ ** High cohesion** means that the elements within the module work closely together and share a common purpose.
11
+ Conversely , ** low cohesion** means that the elements within the module perform various
12
12
unrelated tasks, making the module less organized and harder to understand.
13
13
14
14
To improve cohesion, ensure that each class and method has a clear and singular responsibility.
@@ -19,6 +19,6 @@ impacting others.
19
19
On the other hand, ** high coupling** means that the parts are closely interconnected, so changes in one part may affect
20
20
many others.
21
21
22
- To improve coupling, use Move refactoring to reorganize code elements, such as methods and fields, to reduce direct
22
+ To lessen coupling, use Move refactoring to reorganize code elements, such as methods and fields, to reduce direct
23
23
dependencies between different modules or classes.
24
24
Reducing coupling while increasing cohesion leads to a more maintainable and flexible codebase.
0 commit comments