wheelify method contains the only bit of code that understands the structure of the incoming array. If the input changes, the code will change in just this one place.
- 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
there is just 1 place where
wheel.tire is defined .... if array changes this is the only place where changes need to be made.
IE. Array = TireSize
Array = TireSize .... then only 1 place that needs this change
Share this highlighthttp://www.safaribooksonline.com/a/practical-object-oriented-design/70790/