Cohesion

noun

say it: “koh-HEE-zhun” /koʊˈhiːʒən/

How closely the parts of a class belong together; a class with high cohesion does one clear job.

What is Cohesion?

Cohesion is how closely the things inside one class belong together. A highly cohesive Invoice class deals only with invoices, not also with sending emails and resizing images.

In a sentence

  • “Moving the email code out of Order gave the class better cohesion.”

Level: Journeyman · More OOP terms at this level

Updated