Question: You have modules that are dependent on each other. If you change one module, you have to make changes in the dependent modules. What term is used to describe this problem, and what is a potential solution?

  1. Cohesion. A solution is to show that each module has certain responsibilities and to use an anticohesive design pattern.
  2. Encapsulation. A solution is to implement one of the SOLID principles to ensure the modules do not encapsulate with each other.
  3. Coupling. A solution is to refactor the code to be loosely coupled by using inversion of control and dependency injection.
  4. Dependency. A solution is to implement polymorphism and abstraction to change and extract dependent elements of a module so that it functions on its own.

Answer: The correct answer of the above question is Option C:Coupling. A solution is to refactor the code to be loosely coupled by using inversion of control and dependency injection.