Chapter 36. Mary's Dilemma

Herb finished his Chain of Responsibility development and made the framework available for the rest of his project group. One of his first users was Mary, who suddenly discovered that she had a number of additional requirements that Herb's chain did not fulfill. She wanted to be able to produce summaries of each document.

"For example," she told Sandy, "I need to keep sentence numbers and word numbers of every term that we find in a document. Herb has that information, but he doesn't store it anywhere."

"Why don't you subclass Herb's classes and store the data in whichever class you need it?" asked Sandy.

"I don't know what else I'll need until Ifinish developing the algorithms, and I don't want to take a chance that ...

Get Java™ Design Patterns: A Tutorial now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.