![](https://csdnimg.cn/release/download_crawler_static/5655575/bg14.jpg)
FOREWORD
xviii
the time. This book shows you how to think about divide-and-conquer and how to
avoid some of the safety flaws.
When I saw the chapter on classloading, I thought they had gone a bit too far. Here
were the tricks that my friends and I had used to create magical code, laid bare for all to
learn! They explain how
javap
works, a little tool that can give you insight into the byte-
code generated by the Java compiler. They also cover the new
invokedynamic
and
explain how it differs from plain reflection.
One chapter that I particularly like is “Understanding performance tuning.” This
is the first book since Jack Shirazi’s Java Performance Tuning that has captured the
essence of how to make your system faster. I can summarize the chapter in three
words: “Measure, don’t guess.” This is the essence of good performance tuning. It’s
impossible for a human to guess which code is slow. Instead of offering a single coding
trick, this chapter explains performance from a hardware perspective. It also shows
you how to measure the performance. An interesting little benchmark tool is their
CacheTester
class, which shows the cost of cache misses.
Part 3 of the book explains polyglot programming on the
JVM
. Java is so much more
than a Java programming language. It’s also a platform on which other languages can run.
We’ve seen an explosion of different types of languages. Some are functional, some are
declarative. Some are ports (Jython and
JR
uby), allowing other languages to run on the
JVM
. Languages can be dynamic (Groovy) or stable (Java and Scala). There are many
reasons to use a non-Java language on the
JVM
. If you’re starting a new project, look at
what’s available before deciding. You might save yourself a lot of boilerplate code.
Ben and Martijn show us three alternative languages: Groovy, Scala, and Clojure. In
my opinion, these are the most viable languages at the moment. The authors describe
the differences between these languages, how they compare to Java, and their special
features. The chapter on each language is just enough to help you figure out which you
should be using, without too much technical detail. Don’t expect a reference manual to
Groovy; do expect insight on which language is the right one for you.
Next, you’ll gain insight into how to do test-driven development and continuous
integration of your system. I found it amusing that the old faithful butler Hudson was
so quickly replaced with Jenkins. In any case, these are essential tools for managing
your project, along with tools like Checkstyle and FindBugs.
Studying this book will help you become a well-grounded Java developer. Not only
that, it will give you tips on how to stay well-grounded. Java is constantly changing. We’ll
see lambdas and modularization in the next version. New languages are being designed;
the concurrency constructs are being updated. Many of the things that you know are
true now might not be true in the future. The lesson is, don’t ever stop learning!
The other day I drove past the petrol station where Ben wanted to buy his beer.
Like so many companies in depressed Greece, it had closed. I never did find out if
they sold beer.
D
R
. H
EINZ
K
ABUTZ
T
HE
J
AVA
S
PECIALISTS
’ N
EWSLETTER
www.it-ebooks.info