In addition to the answers given so far, an easy way to think about high cohesion is the lack of duplication of functionality and a clear separation of related functions into separate modules, components or classes. That way, if you need a function similar to another function, and you cut and paste and subsequently modify a copy of the code, you decrease integrity. If you change the original to handle a new case, when the new case is clearly related to existing functionality, you increase cohesion. In other words, if your program needs to do a certain thing, no matter how many times or how many places, for maximum cohesion there should be only one piece of code that does this. At the same time, this class, module or component should have one area of ​​responsibility. Combining unrelated functionality into one class or component also reduces grip.
As stated in the CodeWiki, cohesion is usually discussed through communication, where they can act against each other, especially where strict interfaces are not carefully planned. Many of the googled association articles are related to OO design, but cohesion and communication are not limited to OO.
source share