Java Reference
In-Depth Information
Chapter 1. Why add Groovy to Java?
This chapter covers
• Issues with Java
• Groovy features that help Java
• Common use cases for Java and how Groovy makes them simpler
For all of its flaws (and we'll be reviewing them shortly), Java is still the dominant object-
oriented programming language in the industry today. It's everywhere, especially on the
server side, where it's used to implement everything from web applications to messaging
systems to the basic infrastructure of servers. It's therefore not surprising that there are more
Java developers and more Java development jobs available than for any other programming
language. As a language, Java is an unmitigated success story.
If Java is so ubiquitous and so helpful, why switch to anything else? Why not continue using
Java everywhere a Java Virtual Machine (JVM) is available?
In this topic, the answer to that question is, go right ahead. Where Java works for you and
gets the job done, by all means continue to use it. I expect that you already have a Java back-
ground and don't want to lose all that hard-earned experience. Still, there are problems that
Java solves easily, and problems that Java makes difficult. For those difficult issues, con-
sider an alternative.
That alternative is Groovy. In this chapter I'll review some of the issues with Java that lead
to problems for developers and discuss how Groovy can help alleviate them. I'll also show
a range of tools, provided as part of the Groovy ecosystem, that can make pure Java devel-
opment easier. In the long run, I suggest a blended approach: let Java do what it does well,
and let Groovy help where Java has difficulties.
Throughout, this will be the mantra:
Guiding Principle
Java is great for tools, libraries, and infrastructure. Groovy is great for everything else.
Search WWH ::




Custom Search