Methods, like classes, should have a single responsibility. All of the same reasons apply; having just one responsibility makes them easy to change and easy to reuse. All the same design techniques work; ask them questions about what they do and try to describe their responsibilities in a single sentence.
- Chapter 2. Designing Classes with a Single Responsibility
- from Practical Object-Oriented Design in Ruby: An Agile Primer
- Publisher: Addison-Wesley Professional
- Released: September 2012
Write methods to have a single responsibility.
Share this highlighthttp://www.safaribooksonline.com/a/practical-object-oriented-design/3506/