I'm trying to understand what the responsibility really is, so I want to use an example of what I'm currently working on. I have an application that imports product information from one system to another. The application user selects various parameters for the product fields in one system that they want to use in another system.
So, I have a class, say ProductImporter, and responsibility for importing products. This class is big, probably too big.
The methods in this class are complex and will, for example, getDescription. This method not only captures the description from another system, but sets the product description based on various settings specified by the user. If I added a parameter and a new way to get a description, this class could change.
So these are two responsibilities? Is there one that imports the products, and one that receives the description. It would seem that almost every method that I have will be a class in it, and this seems redundant.
I really need a good description of this principle, because it's hard for me to fully understand. I do not want unnecessary complexity.
source
share