Forces Vs Consequences

I was trying to explain this to a friend via email. I wrote a great deal, trying to communicate from many different angles, hoping one of them would make things "click" for my reader. This was the one that he said worked for him. He thought I should put it up on the WWW somewhere in case it just might click with others as well.

When writing a pattern, many people have trouble with the forces: They have difficulty understanding what forces really mean, and they have difficulty understanding what people mean when they say the forces should create some "tension".

Often, when they try to come up with a set of forces, it turns out they arent really forces. At first glance, it may look like you have a nice collection of forces. But on closer inspection, they fall apart. This is because many folks end up writing forces, that are really consequences.

FORCES may be boundary conditions, limiting factors, competing goals, or constraints imposed upon the set of alternatives you can realistically consider. They may be quantitative constraints on things like performance or size, or coupling. They may be principles or tenets like high cohesion + low coupling.

But when you write forces that look something like:

   IF you do this thing the solution suggests,
   THEN this good thing will happen

This is a CONSEQUENCE not a force. Why? Because it is discussing aspects of the SOLUTION rather than the PROBLEM. This is one reason why many people's write-ups of forces often seem so one-sided. Because they are stated as consequences, which presuppose the solution you are about to recommend. So you have already confined yourself to a single solution in the forces section.

This is undesirable because the forces section should be discussing constraints, and competing concerns about the ENTIRE PROBLEM SPACE! A really strong set of forces will make it look like you are between a rock and a hard place. For example:

If I go this direction, then I have too many dependencies; if I go this way instead, its not very cohesive. If I try door #3, I violate encapsulation; If I try going around all three doors, I waste too much time; If I try to go through the middle, I break my neck. I could use a spoon and try to go "under", but the spoon will break before I finish. etc. No matter what I think of, there seems to be something I have to sacrifice or give up.

This is what MichaelBeedle and others mean when they say the forces should create "tension", or appear to pull you in (or push at you from) every direction. When JimCoplien talks about "good" patterns, involving "catharsis", it is the forces that create the tension which the solution relieves you from (the tension, followed by the relief, is what brings about the catharsis).

A good set of forces will make your head spin and give you a headache from trying to think of all of them at once and which way you should go. A good pattern solution is the Advil or Tylenol that relieves the headache, or at least makes it manageable (with some possible side-effects that may be dealt with later by subsequent patterns).

--BradAppleton


ChristopherAlexander describes forces (almost as well as Brad :-) in NotesOnTheSynthesisOfForm - a criminally neglected book IMO, just because it's not about patterns. --PaulDyson

Actually, I think that "Notes" is about patterns! It was Alexander's thesis, and precursor to his pattern's work later in TTWOB and APL. It focused on the notions of "misfits" and the "forces" which underlie them. Out of this came a theory of the patterns which resolve them them, in Alexander's later works. --BradAppleton


Nice description, Brad. Your " If I try going around all three doors, I waste too much time "example illustrates nicely my personal technique for finding forces - think of all the solutions that could work, but actually don't work... what makes them unsuitable is a force, or a constraint, as you say.

p.s. Paul, for those of us who don't have that book, what does it say about forces? -- AlistairCockburn


EditText of this page (last edited November 25, 1998) or FindPage with title or text search