Chapter 11 . Accommodating Change


Chapter 11. Accommodating Change

Exercise 39. CsvWriter

A. One decision is where to write; the other decision is how to write.

D. Which is better? They're probably not different enough to matter. Either approach could have evolved from a test-driven perspective. It's a bit easier to test the version that produces only a string.


Exercise 40. CheckingAccount

A. One decision is the relationship between CheckingAccount and Transaction; another decision is the representation for money.


Exercise 42. Duplicate Observed Data

This might or might not be a problem. The model/view split often arises out of a real need: pressures to change models and views independently. While the hierarchies may start out in parallel, they needn't remain that way. (You might have multiple views for one model and no views for another.)

You may find that generic models emerge. (Think of how TableModel serves as a generic model for many tablelike things.)


Exercise 43. Documents

A. It affects places all over the class hierarchy.

B. Whether it will be an improvement depends on how it will be used. We don't have enough information to judge.

C. The brief/full and compression/none distinctions will become the wrapping types.




Refactoring Workbook
Refactoring Workbook
ISBN: 0321109295
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net