Guide To The Reader
“Cheshire-Puss will you tell me, please, which way I ought to go from here?”
“That depends a good deal on where you want to get to,” said the Cat.
“I don’t much care where—,” said Alice.
“Then it doesn’t matter which way you go,” said that cat.
“—so long as I get somewhere” Alice added as an explanation.
“Oh, you’re sure to do that,” said the Cat, “if you only walk long enough.”
Louis Carroll, “Alice in Wonderland”
This book is structured so you can read it cover-to-cover. If you know where you want to get to, however, you may want to choose your own route through the book. In this case, the following hints can help you decide which topics to focus upon and the order in which to read them.
If this book is your initial exposure to patterns, we suggest you first read the introduction to patterns in [POSA1] and [GoF95], which explore the concepts and terminology related to patterns for software architectures and designs. In particular, all the patterns presented in this book build upon the conceptual foundation for patterns specified in [POSA1]:
Moreover, the implementations of many patterns in this book are enhanced by using patterns from [POSA1] and [GoF95]. To guide the application of the patterns in production software development projects we therefore suggest you keep all three books handy.
The first chapter in this book, Concurrent and Networked Objects, describes the key challenges of designing concurrent and networked systems. It also outlines the scope and context for the patterns we present. Finally, it presents a case study that applies eight patterns in this book to develop a concurrent Web server.
Sixteen pattern descriptions and one idiom form the main part of this book. We group them into four chapters, corresponding to key problem areas—service access and configuration, event handling, synchronization and concurrency—in the development of concurrent and networked middleware and applications. The order in which you read this material is up to you. One approach is to read important core patterns first:
The other twelve patterns and one idiom in the book are arranged to minimize forward references. You can read them in any order of course, and we provide page numbers for following references to other patterns within the book. This material completes and complements the concepts defined by the four patterns listed above and covers a range of issues relevant to designing and implementing concurrent and networked objects effectively.
You can also use this book to find solutions to problems you encounter in your projects. Use the overview of our patterns in Chapter 6, Weaving the Patterns Together, to guide your search, then locate in Chapters 2 through 5 the detailed descriptions of the patterns you select as potential solutions.
No pattern is an island, completely separated from other patterns. Therefore, Chapter 6, Weaving the Patterns Together, also describes how all the patterns in this book can be woven together to form a pattern language for building networked applications and middleware. If you want an overall perspective of the patterns in this book before delving into the individual patterns, we recommend you skim the pattern language presentation in Chapter 6 before reading the patterns in Chapters 2 through 5 in depth.
Chapter 7, The Past, Present, and Future of Patterns and Chapter 8, Concluding Remarks complete the main content of this book. The remainder of the book consists of a glossary of technical terms, an overview of the notations used in the figures, references to related work, and an index of patterns, topics, and names.
All patterns presented in this book are self-contained, following the [POSA1] pattern form. This form allows us to present both the essence and the key details of a pattern. Our goal is to serve readers who simply want an overview of the pattern’s fundamental ideas, as well as those who want to know how the patterns work in depth.
Each section in our pattern form sets the stage for the subsequent section. For instance, the Example section introduces the Context, Problem, and Solution sections, which summarize a pattern’s essence. The Solution section foreshadows the Structure and Dynamics section, which then present more detailed information about how a pattern works, preparing readers for the Implementation section.
The Example Resolved, Variants, Known Uses, Consequences and See Also sections complete each pattern description. We include extensive cross-references to help you to understand the relationships between the patterns in this book and other published patterns.
To anchor the presentation of a pattern’s implementation activities to production software systems, much of the sample code is influenced by components provided in the ACE framework [Sch97]. If you first want to get an overview of all the patterns you may therefore want to skip over the Implementation sections on your initial pass through the book and come back to them when you need to know a particular pattern’s implementation details.
Although the pattern form we use in this book incurs some repetition within the pattern descriptions, we have found that this repetition helps readers navigate through the descriptions more effectively by minimizing ‘back-tracking’.
In the diagrams that explain the structure and behavior of our patterns we tried to follow standard UML whenever possible. In few cases, however, UML did not allow us to express ourselves precisely enough. Thus we ‘extended’ the standard notation slightly, as specified in the Notations chapter.
Many patterns, particularly Reactor (179), Proactor (215), Half-Sync/Half-Async (423), and Leader/Followers (447), assume you are familiar with the following topics:
This book contains an extensive glossary and bibliography to clarify unfamiliar terminology, and suggest sources for information on topics you may want to learn more about. It is not, however, an introductory tutorial on concurrency and network programming. Thus, if you are not familiar with certain topics listed above, we encourage you to do some background reading on the material we recommend in conjunction with reading this book.
1. See the Glossary for a definition of these pattern categories.
2. We adopt the page number notation introduced by [GoF95]. (47) means that the corresponding pattern description starts on page 47.