Manning Publications, 2012. - 496 Pages
ISBN: 1617290068
The Well-Grounded Java Developer offers a fresh and practical look at new Java 7 features, new JVM languages, and the array of supporting technologies you need for the next generation of Java-based software.
The Well-Grounded Java Developer starts with thorough coverage of Java 7 features like try-with-resources and NIO
.2. You'll then explore a cross-section of emerging JVM-based languages, including Groovy, Scala, and Clojure. You will find clear examples that are practical and that help you dig into dozens of valuable development techniques showcasing modern approaches to the dev process, concurrency, performance, and much more.
Written for readers familiar with Java. No experience with Java 7 or new JVM languages required.
What's Inside New Java 7 features
Tutorials on Groovy, Scala, and Clojure
Discovering multicore processing and concurrency
Functional programming with new JVM languages
Modern approaches to testing, build, and CI
Ben Evans is the CEO of a Java performance firm and a member of the Java Community Process Executive Committee. Martijn Verburg is the CTO of a Java performance firm, co-leader of the London JUG, and a popular conference speaker.
Contentsforeword
preface
acknowledgments
about this book
about the authors
about the cover illustration
Developing with Java 7
Introducing Java 7
The language and the platform
Small is beautiful—Project Coin
The changes in Project Coin
Summary
New I/O
Java I/O—a history
Path—a foundation of file-based I/O
Dealing with directories and directory trees
Filesystem I/O with NIO.2
Asynchronous I/O operations
Tidying up Socket-Channel functionality
Summary
Vital techniques
Dependency Injection
Inject some knowledge—understanding IoC and DI
Standardized DI in Java
Guice 3—the reference implementation for DI in Java
Summary
Modern concurrency
Concurrency theory—a primer
Block-structured concurrency (pre-Java 5)
Building blocks for modern concurrent applications
Controlling execution
The fork/join framework
The Java Memory Model (JMM)
Summary
Class files and bytecode
Classloading and class objects
Using method handles
Examining class files
Bytecode
Invokedynamic
Summary
Understanding performance tuning
Performance terminology—some basic definitions
A pragmatic approach to performance analysis
What went wrong? Why we have to care
A question of time—from the hardware up
Garbage collection
JIT compilation with HotSpot
Summary
Polyglot programming on the JVM
Alternative JVM languages
Java too clumsy? Them’s fighting words!
Language zoology
Polyglot programming on the JVM
How to choose a non-Java language for your project
How the JVM supports alternative languages
Summary
Groovy: Java’s dynamic friend
Getting started with Groovy
Groovy 101—syntax and semantics
Differences from Java—traps for new players
Groovy features not (yet) in Java
Interoperating between Groovy and Java
Summary
Scala: powerful and concise
A quick tour of Scala
Is Scala right for my project?
Making code beautiful again with Scala
Scala’s object model—similar but different
Data structures and collections
Introduction to actors
Summary
Clojure: safer programming
Introducing Clojure
Looking for Clojure—syntax and semantics
Working with functions and loops in Clojure
Introducing Clojure sequences
Interoperating between Clojure and Java
Concurrent Clojure
Summary
Crafting the polyglot project
Test-driven development
TDD in a nutshell
Test doubles
Introducing ScalaTest
Summary
Build and continuous integration
Getting started with Maven 3
Maven 3—a quick-start project
Maven 3—the Java7developer build
Jenkins—serving your CI needs
Code metrics with Maven and Jenkins
Leiningen
Summary
Rapid web development
The problem with Java-based web frameworks
Criteria in selecting a web framework
Getting started with Grails
Grails quick-start project
Further Grails exploration
Getting started with Compojure
A sample Compojure project—Am I an Otter or Not?
Summary
Staying well-grounded
What to expect in Java 8
Polyglot programming
Future concurrency trends
New directions in the JVM
Summary
appendix A Java7developer—source code installation
appendix B Glob pattern syntax and examples
appendix C Installing alternative JVM languages
appendix D Downloading and installing Jenkins
appendix E Java7developer—the Maven POM
index