Reinforce the principles of cohesion and coupling as they apply to class modeling.
Cohesion and Coupling Revisited
Cohesion and coupling are measures of quality for your model. As such, they should be applied to every activity of the modeling process.
Like encapsulation, cohesion and coupling may and should be applied to every level your model, not just to individual class design.
Key to achieving High Cohesion
The key to achieving high cohesion and low coupling is defining purpose. The best way I have found to understand this concept is to think in terms of human interaction. People and organizations work best when they have a single, well-defined purpose.
When the purpose is poorly defined, people have a hard time setting priorities, developing a plan of action, and coordinating unrelated tasks. Cohesion Business Example
Systems, applications, components, and objects react in the same way. Actually, it is the developers who react in the same way. Development becomes increasingly complex as you attempt to put more and more functionality into the same component.
More and more code is required to track object state, juggle priorities, and manage the execution of loosely related or unrelated activities.
Refactoring for higher cohesion
Refactoring for higher cohesion and looser coupling is usually a matter reassigning responsibilities and the associated functionality.
The diagrams below will show you two examples of refactoring.
In the first example, the initial job description for a Software Developer is refactored so that the skill and tool sets in the initial definition are distributed into three distinct job classifications.
In the second example, the definitions for a security user interface and a security client are refactored so that their responsibilities are divided in such a way so as to allow the user interface to change without disturbing or even touching the logic behind it.
Initial Job Description Example 1: View the diagram below to examine the initial job description for a Software Developer.
Example 2: View the diagram below to read about a refactored version of the job description for a Software Developer.
View the diagram below to see a refactored definition for 1) a Security User Interface and 2) Security Client Application
You can see from the examples that refactoring based on cohesion and coupling typically results in more objects that are also smaller and simpler, and consequently far more reusable.