Java Reference
In-Depth Information
2.4. Summary
This chapter is a tutorial on Groovy for Java developers, using example applications rather
than a series of features. What's remarkable is how much Groovy simplifies the code.
POGOs are a minimal yet more flexible version of POJOs. The
groovy.sql.Sql
class
makes JDBC practical for reasonably small applications. The Groovy JDK adds many con-
venience methods, like
toURL
and
getText
, which make existing Java classes easier to
use. The combination of maps, closures, and the
join
method makes it simple to build
URLs for web services. Finally, the difference between working with XML in Java and
working with XML in Groovy is staggering. Whenever I have to work with XML in any
form I always look for a way to add a Groovy module to handle the details.
In the next chapter we'll examine mechanisms to integrate Java and Groovy together in
more detail.