Search code examples
design-patternsloose-couplingsoc

separation of concerns vs loose coupling


I would like to understand the difference between separation of concerns and loose coupling.

Is it true that coding by separation of concerns gives a loosely coupled code?

Thank you.


Solution

  • Coupling is about how much each component knows about other components.

    Separation of concerns is about separating different aspects of functionality in different components. You can separate different aspects, but make components tight coupled (i.e. use concrete classes instead of abstractions).

    UPDATE: cohesion shows how closely-related responsibilities of component. When you separate different concerns in different components, then responsibilities of component are strongly-related, thus you have high cohesion.