A class should have just one reason to change

  • Make every class responsible for a single part of the functionality provided by the software, and make that responsibility entirely encapsulated by (hidden within) the class.
  • If you feel that it’s becoming hard to focus on specific aspects of the program one at a time, remember the principle and check whether it’s time to divide some classes into parts.