Cohesion is king!
Cohesion is one of the most fundamental and classical software engineering design principles. It refers to the degree to which the elements of any architecture building block (component, module, subsystem, package etc.) belong together”.
Cohesion is difficult
If it was simple, we wouldn’t write about it… What belongs together will depend on your viewpoint - and might be different for various stakeholders.
There should be consistent, homogeneous rules or principles for cohesion within your system.
Group elements that belong together
Some criteria for elements belonging together:
- similar business functions or processes
- operating on similar data
- used by similar users
- implemented in similar technologies or
- following similar implementation rules/concepts
- deployed in a similar ways or on similar hardware
- distributed or packaged in similar ways
- implemented or maintained by the same people
- <you-name-it>