CSE 201 Chapter Notes - Chapter 5: Duplicate Code, User Story, Single Responsibility Principle

40 views2 pages

Document Summary

5 - good-enough design: getting it done with great design. Design can be refactored to make team more productive. Well-designed classes are singularly focused: if you need to make modifications, you only have to do so in one place. Single responsibility principle: every object in your system should have a single responsibility, and all the object"s services should be focused on carrying out that single responsibility. You"ve implemented correctly when each of your objects has only one reason to change. How to spot classes not using srp: Write lines on paper with the [blank] [blanks] itself. Put class name in first blank and one of methods in second blank. Do this for each method in class. Getting from multiple responsibilities to a single responsibility. After analysis, take methods that don"t make sense on class and move to one that does. Design should obey srp, but also be dry.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions