Catalog
concept#Architecture#Software Engineering#Cohesion

High Cohesion

High cohesion refers to the strength of the interrelationships between elements within a module.

High cohesion is a principle in software architecture aimed at ensuring that modules perform closely related functions.
Established
Medium

Classification

  • Medium
  • Technical
  • Design
  • Advanced

Technical context

Version control tools like GitContinuous Integration/Continuous Deployment systemsTest automation tools

Principles & goals

ModularizationInternal CoherenceMaintainability
Build
Team, Domain

Use cases & scenarios

Compromises

  • Misunderstandings in modularization.
  • Lack of integration between highly cohesive modules.
  • Insufficient documentation can lead to confusion.
  • Conduct regular code reviews.
  • Clearly define module boundaries.
  • Keep documentation up to date.

I/O & resources

  • Existing documentation for the application
  • Requirement documents
  • Feedback from users
  • Clean, well-structured code
  • Documentation for modules
  • User-friendly interfaces

Description

High cohesion is a principle in software architecture aimed at ensuring that modules perform closely related functions. This results in improved maintainability, reusability, and understandability of code, as changes in a high-cohesion module have less impact on other modules.

  • Increased maintainability
  • Better reusability
  • Clearer structure

  • Excessive modularization can impact performance.
  • High cohesion can jeopardize reliability in some situations.
  • Difficulties in adapting existing modules.

  • Number of Modules

    Number of developed modules exhibiting high cohesion.

  • Code Reusability Rate

    Percentage of code that is reused.

  • Maintenance Effort

    Effort required for code maintenance and upkeep.

E-Commerce Platform

A modular e-commerce system that promotes high cohesion by grouping related functions into separate modules.

Content Management System

A CMS with well-structured modules to facilitate maintainability and reusability for editors and developers.

Financial Application

An application leveraging high cohesion to achieve a clear separation between various financial processes and functions.

1

Create a comprehensive architecture plan

2

Develop and test modules

3

Gather feedback from stakeholders

⚠️ Technical debt & bottlenecks

  • Legacy code that has not been refactored.
  • Weak tests that undermine confidence.
  • Lack of documentation leads to knowledge loss.
Complex dependencies between modulesDifficulties in onboarding new staffMisunderstandings about module boundaries
  • Functions that are overloaded in a single module.
  • Disregarding modular principles.
  • Lack of documentation for modules.
  • Emphasizing modularity but neglecting cohesion.
  • Neglecting lack of integration.
  • Being sloppy in the implementation of modules.
Knowledge of software architectureExperience in modularizationAbility to document modules
Modularity of Software ArchitectureBest Practices for Software DevelopmentIntegration Tests for Cohesive Modules
  • Collaboration between development teams is required.
  • Clear documentation must be available.
  • The software must integrate with existing systems.