About This Chapter


The diagrams in this chapter are derived from the Booch diagrams in the corresponding chapter of my 1995 book.[6] Those diagrams were created in 1994. As I created them, I also wrote some of the code that implemented them, to make sure that the diagrams made sense. However, I did not write anywhere near the amount of code presented here. Therefore, the diagrams did not benefit from significant feedback from the code and tests. This lack of feedback shows.

[6] [Martin1995]

This chapter appears in my 2002 book.[7] I wrote the code for that chapter in C++ in the order presented here. In every case, test cases were written before production code. In many cases, those tests were created incrementally, evolving as the production code also evolved. The production code was written to comply with the diagrams, so long as that made sense. In several cases, it did not make sense, and so I changed the design of the code.

[7] [Martin2002]

One of the first places that this happened was when I decided against multiple Affiliation instances in the Employee object. Another was when I found that I had not considered recording the employee's membership in the union in the ChangeMember-Transaction.

This is normal. When you design without feedback, you will necessarily make errors. It was the feedback imposed by the tests cases and running code that found these errors for us.

This chapter was translated from C++ into C# by my coauthor, Micah Martin. Special attention was paid to C# conventions and styles, so that the code would not look too much like C#++. (You can find the final version of this code on the Prentice Hall Web site or on www.objectmentor.com/PPP/payroll.net.zip.) The diagrams were left unchanged, except that we replaced composition relationships with associations.




Agile Principles, Patterns, and Practices in C#
Agile Principles, Patterns, and Practices in C#
ISBN: 0131857258
EAN: 2147483647
Year: 2006
Pages: 272

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