|
|
Pattern Recognition, Classification
- You can write perfect Java programs without using patterns,
but much of your time
will be needlessly wasted. Mastering patterns is required for
mastering
Java, yet many programmers don't do it!
- Patterns rely heavily on interfaces, polymorphism, and
abstraction.
A good pattern programmer will use these components.
- Using patterns helps you make forward-thinking, re-usable
code.
- PatternDepot.com states three stages in learing patterns:
- Acceptance - realize that patterns are important.
- Recognition - realize that you need to study patterns to
know how to use
them.
- Internalization - reach the 'aha' factor where thinking
of programming
with patterns is automatic.
- Unfortunately, patterns are hard to teach and learn in
a classroom.
But they are very important. After hours and years of
programming,
patterns become invaluable. The moral? This is one thing
we'll
talk about now, but you might find that you actually learn it months or
years after you have forgotten my name!
- The folks at www.patterndepot.com have divided 23 of the
most common patterns
into three categories:
- Creational Patterns are in the business of
creating objects.
The Factory Pattern would fall under this category.
- Structural Patterns compose objects into more
complex structures.
- Behavioral Patterns define communication among
objects. The
command pattern, one of my favorite, falls in this category.
- Many of the 23 patterns are complex and best suited for
programmers who
have years of experience. As a matter of fact, most patterns are
not designed ahead of time, but rather discovered after review of many
previously written programs. We won't cover the more complex
patterns.
But there are a number of patterns that are simple and fundamental -
some
you may have already used with our without knowing it!
Creational
Patterns
|