You're looking at this from the wrong perspective. Maybe it helps if we use a real world analogy.
The company has 15 employees. They all get a wage, which is done by using the company accounting software.
The company decides to instruct all employees, so that each employee can do their own administration and have their wage paid (let's assume no stealing/malice). Everything works as intended.
The accounting tool has had an update, or the company has decided to use a different tool altogether. It takes a full day course to teach someone how to use the new tool. All 15 employees need to attend this course.
After a while, the company starts noticing problems with the accounting.
- The company can't afford to have all of its employees unavailable for a day whenever there's an update to the software.
- Not all employees are as good at math as the others. The ones that are bad at math are doing their best, but math really isn't their strong suit.
- Some employees are filing the records alphabetically by first name. Other employees are filing them alphabetically by last name. Either option is fine, but because there are two different ways of doing things, people often can't find a file where they expect to find it. Both sides of this debate argues that the other group should change their approach, since their own approach is perfectly workable.
The company changes its approach. They hire a 16th employee ("the accountant"), who is responsible for paying the wages. And immediately, the benefits becomes clear:
- Employees no longer have to take time out of their day to do administration, so they can focus on their actual job more.
- When the software tool is updated, only the accountant needs to attend the full day course.
- The accountant files things however he sees fit. Since no one else is doing the accounting, there is are no conflicting approaches.
- The company hired an accountant with the adequate amount of math skill. When hiring an accountant, the company only needs to care about their accounting skills. They don't care if the accountant does or doesn't have other skills too (e.g. sales).
- When hiring new non-accountant employees, the company doesn't need to ensure that they hire someone capable of doing basic accounting. Instead, they simply hire whoever is best at the core skill for the job.
The job of accounting is only done by the accountant.
There is something else to consider.
If the accountant would be doing multiple jobs (accounting, production, sales), he would need to attend courses for all three departments whenever a course was scheduled. This means that when he's out of office for an accounting course, he's unavailable to create products or sell them to customers; even though the jobs of producing/selling goods have not changed and do not require any training.
The more jobs he has, the more often he is unavailable for all of his jobs while he is in a course for one of his jobs.
This is bad. It's better to have three part-time employees (accountant, production staff, salesman) than it is to have one employee who has to juggle multiple jobs. It's harder to find the right employee with the right skillset, and each of their multiple responsibilities distract the employee from their other responsibilities.
The accountant should only do the job of accounting
Combining the two conclusions, we get to the SRP.
One actor is solely responsible for no more than one task.
Some examples of this:
- I want logging in my application, across all the projects. However, it takes some effort to find the correct file to log to. So instead, I create a
Logging project ("the accountant") whose sole job it is to take a message ("employee timesheet") and write the message to the appropriate destination ("pay the employee's wage").
- I want to access my database in many parts of the code. However, it takes some effort to set up the connection and handle any possible errors. So instead, I create a
Database project ("the accountant") whose sole job it is to provide simplified access ("account report") and internally handles the complex logic of getting the data ("generating the account report from the archive").
There is a common thread here: the existence of the single actor (accountant/logging project/database project) is only justified if they simplify the task at hand or enforce consistency. It's easier to ask someone to pay your wage than it is to do it yourself. It's easier to ask someone to log your message than it is to log it yourself.
If it takes five times longer to ask the accountant to do something than it does to do it yourself, and there's no issue with you doing it your own way, then you shouldn't hire that accountant.
Just for completeness' sake; I left out that the accountant does become a single point of failure. When he is absent from work, no one gets paid. In the old system where everyone paid their own wage, that wasn't an issue. However, the better solution here is to have a backup accountant (or an accounting department), rather than teaching every employee accounting.
In reality, the company might have too many employees for a single accountant to handle and you need to hire several accountants. However, this does not apply to software, you never need a second class which has identical code and behaves the exact same way.