Java Reference
In-Depth Information
Chapter 1. Introduction To Patterns
This topic is for developers who know Java and who have had some exposure to the topic
Design Patterns (Gamma et al. 1995). The premise of this topic is that you want to
Deepen your understanding of the patterns that Design Patterns describes
Build confidence in your ability to recognize these patterns
Strengthen your ability to apply these patterns in your own Java programs
Why Patterns?
A pattern is a way of doing something, or a way of pursuing an intent. This idea applies to
cooking, making fireworks, developing software, and to any other craft. In any craft that is
mature or that is starting to mature, you can find common, effective methods for achieving
aims and solving problems in various contexts. The community of people who practice a craft
usually invent jargon that helps them talk about their craft. This jargon often refers to patterns,
or standardized ways of achieving certain aims. Writers document these patterns, helping to
standardize the jargon. Writers also ensure that the accumulated wisdom of a craft is available
to future generations of practitioners.
Christopher Alexander was one of the first writers to encapsulate a craft's best practices by
documenting its patterns. His work relates to architecture—of buildings, not software.
A Pattern Language: Towns, Buildings, Construction (Alexander, Ishikawa, and Silverstein
1977) provides patterns for architecting successful buildings and towns. Alexander's writing is
powerful and has influenced the software community, partially because of the way he looks at
intent.
You might state the intent of architectural patterns as "to design buildings." But Alexander
makes it clear that the intent of architectural patterns is to serve and to inspire the people who
will occupy buildings and towns. Alexander's work showed that patterns are an excellent way
to capture and to convey the wisdom of a craft. He also established that properly perceiving
and documenting the intent of a craft is a critical, philosophical, and elusive challenge.
The software community has resonated with Alexander's approach and has created many
topics that document patterns of software development. These topics record best practices for
software process, software analysis, and high-level and class-level design. Table 1.1 lists
topics that record best practices in various aspects of software development. This list of topics
is not comprehensive, and new topics appear every year. If you are choosing a topic about
patterns to read you should spend some time reading reviews of available topics and try to
select the topic that will help you the most.
Why Design Patterns?
A design pattern is a pattern—a way to pursue an intent—that uses classes and their methods
in an object-oriented language. Developers often start thinking about design after learning a
programming language and writing code for a while. You might notice that someone else's
code seems simpler and works better than yours does, and you might wonder how that person
achieves this simplicity. Design patterns are a level up from code and typically show how to
achieve a goal, using one to ten classes. Other people have figured out how to program
Search WWH ::




Custom Search