Java Reference
In-Depth Information
Appendix A. Directions
If you have read the topic up to this point, allow me to say, "Congratulations!" If you have
worked through all the challenges, I salute you! I feel confident that if you have read this
topic and worked the challenges, you have learned a lot about patterns. Now where can you
go from here?
Get the Most from This Topic
If you have not worked through the challenges in this topic, you are not alone! We are all
busy, and it is quite tempting to think about a challenge momentarily and to then glance at the
solution. That is certainly an ordinary experience, but you have the potential to become an
extraordinary developer. Go back and rework the challenges, turning to the solutions only
when you think you've got a correct answer or when you're completely stumped. Work
through the challenges now; don't kid yourself that you'll somehow have more time later. By
exercising your patterns knowledge on these challenges, you'll build the confidence you need
to start applying patterns in your work.
In addition to working the challenges in this topic, I suggest that you download the code from
www.oozinoz.com and ensure that you can repeat the results of this topic's examples on your
own system. Knowing that you can get the code to run will give you more confidence than
simply working examples on paper. You may also want to set up new challenges for yourself.
Perhaps you will want to combine decorator filters in a new way or implement the
TableModel interface with a class that shows data from a familiar domain.
As you build fluency with design patterns, you should start to see that you understand classic
examples of design patterns. You will also begin to find ways to incorporate design patterns
in your own code.
Understand the Classics
Design patterns often make a design stronger. This is not a new idea, so it is no surprise that
many design patterns are built into the Java class libraries. If you can spot the design pattern
in a body of code you can grasp the design yourself and communicate it to others who
understand design patterns. For example, if a developer understands the D ECORATOR pattern,
it is meaningful to explain that Java streams are decorators.
Here is a test of your understanding of some of the classic examples of design patterns that
appear in Java.
How do Swing listeners use the O BSERVER pattern?
Why do menus often use the C OMMAND pattern? How can you use the C OMMAND
pattern with Swing menus?
Why are drivers a good example of the B RIDGE pattern? Is each particular driver an
instance of the A DAPTER pattern?
What does it mean to say that Java streams use the D ECORATOR pattern?
Why is the P ROXY pattern fundamental to the design of RMI?
If sorting provides a good example of the T EMPLATE M ETHOD pattern, which step of
the algorithm is left unspecified?
Search WWH ::




Custom Search