1 These articles are available in the publications section of There are four articles. The first three are entitled “Iterative and Incremental Development” (I, II, III). The last is entitled “C.O.D.E Culled Object Development process.”

2 The website contains a vast number of articles on an immense variety of subjects. Its authors number in the hundreds or thousands. It has been said that only Ward Cunningham could instigate a social revolution using only a few lines of Perl.

3 Any credible intellectual work written between 1995 and 2001 must use the term Kuhnian. It refers to the book The Structure of Scientific Revolutions, by Thomas S. Kuhn, University of Chicago Press, 1962.

4 If you mention Kuhn twice in paper, you get extra credit.

5 Kent Beck, Test-Driven Development by Example, Addison-Wesley, 2003.

Section I

1 Private communication

Chapter 1

1 “Product-Development Practices That Work: How Internet Companies Build Software,” MIT Sloan Management Review, Winter 2001, reprint number 4226.



4 Peter Coad, Eric Lefebvre, and Jeff De Luca, Java Modeling in Color with UML: Enterprise Components and Process, Prentice Hall, 1999.

5 [Highsmith2000]

6 [Beck99], [Newkirk2001]

Chapter 2

1 See

2 I have seen pairs in which one member controls the keyboard and the other controls the mouse.

3 [Williams2000], [Cockburn2001]

4 [Nosek98]

5 I’m not advocating a three-tiered architecture here. I simply chose three common partitions of software technology.

6 Ron Jeffries says, “End to end is farther than you think.”


8 [Fowler99]

Chapter 3

1 [Beck99], [Newkirk2001]



4 [Cockburn2005]

5 Peter Coad, Eric Lefebvre, and Jeff De Luca, Java Modeling in Color with UML: Enterprise Components and Process, Prentice Hall, 1999.

6 [Highsmith2000]

7 Scientific Wild-Assed Guess

8 Many developers find it helpful to use “perfect programming hours” as their task points.

Chapter 4

1 [Jeffries2001]

2 [Mackinnon2000]

3 A test that knows and depends on the internal structure of the module being tested.

4 A test that does not know or depend on the internal structure of the module being tested.


6 The manner in which FitNesse calls these API functions is beyond the scope of this book. For more information, consult the FitNesse documentation. Also see [Mugridge2005].

Chapter 5

1 [Fowler99], p. xvi

2 I once watched Kent Beck refactor this very same program. He did away with the square root altogether. His rationale was that the square root was difficult to understand and that no test that failed if you iterated right up to the size of the array. I can’t bring myself to give up the efficiency. I guess that shows my assembly language roots.

Chapter 6

1 Dave Thomas and Andy Hunt call this programming by coincidence.


Chapter 7

1 [Reeves92] This is a great paper. I strongly recommend you read it. It is included in this book in Appendix B on page 687.

2 For those of you who do not have English as your first language, the term fravle the arvadent is composed of nonsense words and is meant to imply some nondescript programming activity.

3 Actually, the practice of test-driven development would very likely force the design to be flexible enough to endure the boss without change. However, in this example, we’ll ignore that.

Chapter 8

1 [DeMarco79], p. 310

2 [PageJones88], p. 82

Chapter 9

1 [Jacobson92], p. 21

2 [Meyer97]

3 In C/C++, changes to enums can cause a change in the size of the variable used to hold the enum. So, great care must be taken if you decide that you don’t need to recompile the other shape declarations.

4 Such objects are known as factories, and we’ll have more to say about them in Chapter 29.

5 It is possible to solve this problem by using the ACYCLIC VISITOR pattern described in Chapter 35. Showing that solution now would be getting ahead of ourselves a bit. I’ll remind you to come back here at the end of that chapter.

Chapter 10

1 [Liskov88]

2 On a reasonably fast machine, that overhead is on the order of 1ns per method invocation, so it’s difficult to see Joe’s point.

3 Often, you will find that those reasonable assumptions are asserted in the unit tests written for the base class. This is yet another good reason to practice test-driven development.

4 [Meyer97], p. 331

5 [Meyer97], p. 573

6 The term weaker can be confusing. X is weaker than Y if X does not enforce all the constraints of Y. It does not matter how many new constraints X enforces.

7 The language was C++, long before the standard container library was available.

8 The original code has been translated into C# here to make it easier for .NET programmers to understand.

9 Despite the similarity of this example to the Square/Rectangle example, it comes from a real application and was subject to the real problems discussed.

10 [Wirfs-Brock90], p. 113

Chapter 11

1 [Booch96], p. 54

2 [Sweet85]

3 Actually, there are ways around this if you can use strings to create classes. C# allows this. So do several other languages. In such languages, the names of the concrete classes can be passed into the program as configuration data.

4 In dynamic languages such as Smalltalk, Pyrhon, or Ruby, the interface simply wouldn’t exist as an explicit source code entity.

Chapter 13

1 [Fowler1999]

Chapter 14

1 A Web-based collaborative document authoring tool. See and

Chapter 17

1 [Cockburn2001]

Chapter 19

1 Actually, it denotes generalization, but as far as a C# programmer is concerned, the difference is moot.

2 This is called a realizes relationship. There’s more to it than simply inheritance of interface, but the difference is beyond the scope of this book and probably beyond the scope of anyone who writes code for a living.

3 The quotation marks that look like double angle brackets « ». These are not two less-than and two greater-than signs. If you use doubled inequality operators instead of the appropriate and proper guillemet characters, the UML police will find you.

4 [Booch94], p. 186

5 Some of you may remember the Booch notation. One of the nice things about that notation was its convenience. It was truly a whiteboard notation.

6 Exercise: Why was it enough to clone the itsLines collection? Why didn’t I have to clone the actual string instances?

7 [GOF95], pp. 163, 175, 207

Chapter 20

1 This problem comes from my first book: [Martin1995], p. 60.

2 That name is particularly appropriate for the kind of coffee that I like to make.

3 OK, I’m having a bit of fun. But what if?

4 [Beck2002]

5 [Martin1995], p. 65

Chapter 21

1 [Lavender96]

Chapter 22

1 [GOF95], p. 20

Chapter 24

2 [GOF95], p. 127

3 This special form of the FACADE pattern is known as a GATEWAY. For a detailed discussion of GATEWAYs, see [Fowler03].

1 I call this the JUST CREATE ONE pattern.

2 I’ve also got this bridge I’d like to sell you.

Chapter 25

1 [PLOPD3], p. 5. This delightful article is full of wit, irony, and quite practical advice.

Chapter 26

1 [Jacobson92]

Chapter 27

1 I could use the VISITOR pattern to solve this problem, but that would probably be way overengineered.

2 OK, the customer is me.

3 And so Bob talks to himself yet again. Go to and look up “Schizophrenic Robert Martin.”

4 This is optimistic. In a simple application, such as payroll, the use of an OODBMS would have very little impact on the design of the program. As applications become more and more complicated, the amount of impact that the OODBMS has on the application increases. Still, the impact is far less than what an RDBMS would have.

5 Sometimes, the nature of the database is one of the requirements of the application. RDBMSs provide powerful query and reporting systems that may be listed as application requirements. However, even when such requirements are explicit, the designers should still decouple the application design from the database design. The application design should not have to depend on any particular kind of database.

6 [Martin1995]

7 [Martin2002]

Chapter 28

1 Webster’s Third New International Dictionary

2 The name main sequence was adopted because of my interest in astronomy and HR (Hertzsprung-Russell) diagrams.

Chapter 29

1 Again, this isn’t exactly necessary in C#. You might get away without recompiling and redeploying clients of a changed interface. But it’s a risky business.

2 We’ll study PROXY in Chapter 34. Right now, all you need to know is that a Proxy is a class that knows how to read particular objects out of particular kinds of databases.

Chapter 30

1 [DeMarco82], p. 3

2 For an example of a shell script, you can download from the freeware section of

3 One might think that a better formula for A is the ratio of abstract methods to total methods within the package. However, I have found that this formula weakens the abstraction metric too much. Even one abstract method makes a class abstract, and the power of that abstraction is more significant than the fact that the class may have dozens of concrete methods, especially when DIP is being followed.

4 It is impossible to plot any package outside the unit square on the A versus I graph, because neither A nor I can exceed 1. The main sequence bisects this square from (0,1) to (1,0). Within the square the points that are farthest from the main sequence are the two corners (0,0) and (1,1). Their distance from the main sequence is


5 I spent about 2 hours compiling by hand the statistics and computing the metrics for the payroll example. Had I used one of the commercially available tools, it would have taken virtually no time at all.

6 As a practical solution, I usually ignore couplings from the main program.

Chapter 31

1 Note the similarity in structure to the PROXY pattern.

Chapter 32

1 [GOF95], p. 293

2 “Push model” observers push data from the subject to the observer by passing it in the Notify and Update methods. “Pull model” observers pass nothing in the Notify and Update methods and depend on the observing object to query the observed object on receiving an update. See [GOF95].

Chapter 33

1 We’ve seen the ADAPTER before, in Figures 10-2 and 10-3.

2 All modems used to be dedicated; it is only in recent geological epochs that modems took on the ability to dial. In the early Jurassic period, you rented a breadbox-sized modem from the phone company and connected it to another modem through dedicated lines that you also rented from the phone company. (Life was good for the phone company in the Jurassic.) If you wanted to dial, you rented another breadbox-sized unit called an autodialer.

3 See Chapter 29.

Chapter 34

1 I have to say that I hate the database access systems in today’s major platforms. The idea of building up SQL strings and executing them is messy at best and certainly baroque. It’s a shame that we have to write programs to generate SQL which was meant to be read and written by humans but that instead is parsed and interpreted by the database engine. A more direct mechanism could (and should) be found. Many teams use persistence frameworks, such as NHibernate, to hide the worst of the arcane SQL manipulations, and this is a good thing. However, these frameworks merely hide what ought to be eliminated.

2 The first three patterns are discussed in Chapter 35. Facade is discussed in Chapter 23.

Chapter 35

1 [GOF95]. For Acyclic Visitor and Extension Object, see [PLOPD3].

2 [PLOPD3], p. 93

3 See Chapter 22.

4 See Chapter 29.

5 Now that you’ve read this chapter, you may wish to go back to Chapter 9 and solve the problem of ordering the shapes.

Chapter 36

1 [GOF95], p. 305

2 See Chapter 22.

3 [PLOPD1], p. 383

4 See Chapter 13, “State Diagrams.”

Chapter 38

1 Or so it seems to the unwary software architect. In many unfortunate cases, this extra infrastructure provides much more benefit to the vendors than to the users.

Appendix B

1 Jack Reeves, “What Is Software Design?” C++ Journal, 2(2), 1992: Reprinted with permission. ©Jack W. Reeves 1992.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.