single responsibility principle

The single-responsibility principle is a programming principle that states that every module, class or function should have responsibility over a single functionality, and it should encapsulate that responsibility. All of that module, class or function's services should be narrowly aligned with that responsibility.
As an example, consider a module that generates and prints a report. Imagine such a module can be changed for two reasons. First, the content of the report could change. Second, the format of the report could change. These two things change for different causes. The single-responsibility principle says that these two aspects of the problem are really two separate responsibilities, and should, therefore, be in separate classes or modules. It would be a bad design to couple two things that change for different reasons at different times.