concept
High Cohesion
High Cohesion is a software design principle that emphasizes grouping related functionality together within a module, class, or component. It ensures that elements within a unit are strongly related and work towards a single, well-defined purpose, improving code readability, maintainability, and reusability. This principle is a core aspect of object-oriented design and clean code practices.
Also known as: Cohesive Design, Strong Cohesion, Cohesion Principle, High Cohesion Principle, Cohesive Modules
π§Why learn High Cohesion?
Developers should apply High Cohesion to reduce complexity and dependencies in their code, making it easier to understand, test, and modify. It is particularly useful in large-scale projects or when working in teams, as it minimizes side effects and enhances modularity, leading to more robust and scalable software systems.
Compare High Cohesion
Learning Resources
πβ
Cohesion (computer science) - Wikipedia
docs
πβ
Clean Code: A Handbook of Agile Software Craftsmanship - Robert C. Martin
book
πβ
SOLID Principles: Single Responsibility and Cohesion - freeCodeCamp
tutorial
πβ
High Cohesion and Low Coupling - GeeksforGeeks
docs
π¬β
Cohesion and Coupling in Software Design - YouTube Tutorial
video