Relative Content

Tag Archive for single-responsibility

Object oriented Classes and single responsibility [duplicate]

This question already has answers here: What is the real responsibility of a class? (8 answers) What are the practical ways to implement the SRP? (6 answers) Closed 9 years ago. I’m reading a book that explain that it is a good thing that classes have a single responsibility, that is, that they do a […]

Object oriented Classes and single responsibility [duplicate]

This question already has answers here: What is the real responsibility of a class? (8 answers) What are the practical ways to implement the SRP? (6 answers) Closed 9 years ago. I’m reading a book that explain that it is a good thing that classes have a single responsibility, that is, that they do a […]

Object oriented Classes and single responsibility [duplicate]

This question already has answers here: What is the real responsibility of a class? (8 answers) What are the practical ways to implement the SRP? (6 answers) Closed 9 years ago. I’m reading a book that explain that it is a good thing that classes have a single responsibility, that is, that they do a […]

Object oriented Classes and single responsibility [duplicate]

This question already has answers here: What is the real responsibility of a class? (8 answers) What are the practical ways to implement the SRP? (6 answers) Closed 9 years ago. I’m reading a book that explain that it is a good thing that classes have a single responsibility, that is, that they do a […]

Rich Domain Models, Encapsulation, and the Problem of Constructor Over-Injection

I am refactoring an e-commerce web-application, currently working on the UserBasket class, which will have to handle adding or removing items, changing their quantity, getting total amount, total number of items etc.. When displaying the basket, the item’s name, description and main-image-filename are also needed.