SOLID OOP development – the simple responsibility principle
In this section focusing on the SOLID development pattern and how it applies to OOP, we will walk through the single responsibility principle. While the concept of single responsibility has been around for a while, it was popularized in 2003 by Uncle Bob.

The single responsibility principle
What exactly is the Single Responsibility Principle (SRP)? The term is pretty self descriptive. Essentially, it means that each class and module in a program should focus on a single task.
The SRP in the real world
Before we go into a code example, let's look at the real-world case study of a vacuum cleaner. A vacuum cleaner can perform a number of tasks such as cleaning floors and upholstery. Some of the more upscale vacuums can even work like a blower. However, notice how, at its core, a vacuum has an engine that utilizes air to perform the task of cleaning?

It wouldn't make sense for a vacuum cleaner to also wash windows. If you introduced this...