"Groovy Project Manager Guillaume Laforge talks with Andrew Glover about what's new in the Groovy 1.6 beta release. Learn about the complexity that has slowed Groovy down in the past and find out what's been done to greatly improve benchmark results in Groovy 1.6. Guillaume also shares tips for optimizing Groovy-based applications and talks about the recent burst of tools support for Groovy; current challenges for the Groovy development team, and what we can expect from upcoming releases such as Groovy 1.7 and 2.0."
"Scott Davis is the self-proclaimed "Java guy" who today edits aboutGroovy.com. Davis believes Groovy is "what the Java language would look like had it been written in the 21st century," and calls it a "concise, natural" language for Java development. In this conversation with Daniel Steinberg, find out what has Davis sold on Groovy (and Grails) and what he has to say about scripting with other dynamic languages for the Java platform, including JRuby and Jython."
"Does this make Groovy just a layer of syntactic sugar? Not at all. Although everything you do in Groovy could be done in Java, it would be madness to write the Java code required to work Groovy's magic. Groovy performs a lot of work behind the scenes to achieve its agility and dynamic nature. As you read this book, try to think every so often about what would be required to mimic the effects of Groovy using Java. Many of the Groovy features that seem extraordinary at first—encapsulating logic in objects in a natural way, building hierarchies with barely any code other than what is absolutely required to compute the data, expressing database queries in the normal application language before they are translated into SQL, manipulating the runtime behavior of individual objects after they have been created—all of these are tasks that Java cannot perform. You might like to think of Groovy as being a "full color" language compared with the monochrome nature of Java—the miracle being that the color pictures are created out of lots of carefully engineered black and white dots."
"Groovy in Action is a comprehensive description of the Groovy programming language, its libraries, and its everyday use. With the release of JSR 241, Groovy has become the second standard language for the Java platform. The book introduces Java developers to the new dynamic features that Groovy brings to this platform."
"K?: Yes. Whenever you need some interactive behavior, interactive dynamic behavior in your application like you want to have a key hole for administrational purposes, or a key hole in your Java application for digging into the internals for support reasons for example, whenever we do support for our Java application for the Groovy enabled, we just go on the customer side and we can look into the internals and into JVM, into the objects, passing any kind of message to them and find out what's going on inside. And this has proven to be so valuable that we use Groovy for all customer-related support issues."
"This is an example of how one can configure a powerful and dynamic development environment while keeping a healthy "separation of concerns," thanks to the new scripting capabilities included in Java 6."
"Intelligent heating control saves not only energy (30-50%), is environmentally friendly, but increases the living comfort as well. Alone the priotirization of energy sources: solar thermal collector, wood buring stove, main heater combining with the inclusion of the weather-forecasts, contributes considerably to the energy saving. This session describes the architecture of the GreenFire project, especially: - Usage of JSR-223 (Scripting Integration) in Java EE 6 / 6 environment for the implementation of flexible rule systems - Reporting - Using EJB 3 timer service - Java EE compatible hardware integration - SunSPOT and sensor network integration - Using Java FX together with Swing and EJB 3 - Sensor Testing (with Junit and mocking) - Speech synthesizer integration (FreeTTS) - Management and monitoring of heating system over the internet - Mobile device Integration - Integration of Multi Media Center Systems"
"As I mentioned in my Chunky Bacon blog entry, I've decided that I've been chugging along with Java/C/C++/perl for far too long. I'm stagnating, and I need to go out and learn something new. As much as I enjoy coding in Java, constant contact with it has dulled my enthusiasm and hardened too many neural pathways for it to really be fun anymore. I was doing C as a friggin' teenager, C++ is giving me ulcers, and perl - well, you know about perl. So it's high time I get off my bum and learn something new."
"The strength of Java is no longer in the language itself; it is in the Java Platform (the JVM, JDK, and rich frameworks and libraries). But recently, the industry has turned to dynamic languages for increased productivity and speed to market."
"You will see how to speed up nearly every aspect of the development process using Groovy. Groovy makes mundane file management tasks like copying and renaming files trivial. Reading and writing XML has never been easier with XmlParsers and XmlBuilders. Breathe new life into Arrays, Maps, and Lists with a number of convenience methods. But Groovy does more than just ease traditional Java development: it brings modern programming features to the Java platform like closures, duck-typing, and metaprogramming."
"Scott Davis is an internationally recognized author, speaker, and software developer. He is the founder of ThirstyHead.com, a Groovy and Grails training company. His books include Groovy Recipes: Greasing the Wheels of Java, GIS for Web Developers: Adding Where to Your Application, The Google Maps API, and JBoss At Work. He writes two ongoing article series for IBM developerWorks: Mastering Grails and Practically Groovy."
"As an example of how Groovy can reduce the associated noise of a plain old Java application, I'll use sample code from Bruce Tate and Justin Ghetland's Spring: A Developer's Notebook (Resources), which introduces Inversion of Control with Spring. As I review each Java example, I'll make a comparison to corresponding Groovy source that is functionally equivalent, and I think you'll see quite quickly how much clearer Groovy makes application code by reducing various aspects of Java programming, which are noisy and don't necessarily convey an application's behavior."
"If you've been hanging out on the Java block for any amount of time then you've likely heard of Groovy. The brainchild of superstar developers James Strachan and Bob McWhirter, Groovy is an agile development language that is based entirely on the Java programming APIs. Groovy is currently in the beginning phase of its Java Specification Request, which was approved in late March of 2004. Groovy is also the scripting language that some claim will forever change the way that you view and utilize the Java platform."
"In this installment of Practically Groovy, I'll show you how easy it is to enhance the build process by using Groovy rather than XML as your build configuration format. Closures are an important feature of Groovy and central to the language's expressiveness, so I'll start with a quick review of closures before moving on."
"In this month's installment of Practically Groovy, you've seen how GroovySql can simplify JDBC programming. This nifty API combines closures and iterators with Groovy's relaxed syntax to facilitate rapid database application development on the Java platform. Most powerfully, GroovySql shifts resource management tasks from the developer to the underlying Groovy framework, letting you focus on the more important stuff of queries and results. But don't just take my word for it. Next time you're asked to delve into the drudgery of JDBC, try a little GroovySql magic on it instead. Then send me an e-mail and tell me about your experience."
"I've shown in recent articles in the Practically Groovy series that Groovy is a superb tool for constructing reporting applications. I used a checksum reporting application example to show you the basics of Ant scripting with Groovy and a database statistics report to demonstrate the benefits of JDBC programming with GroovySql. Both of these example reports were generated inside a Groovy script and both, by nature, had a "view" associated with them."
"Groovy's Builders let you effortlessly mimic markup languages like XML, HTML, Ant tasks, and even graphical user interfaces with frameworks like Swing. With a builder, you can quickly create a sophisticated markup like XML without having to deal with XML itself."
"Not only will Barclay and Savage's curried closures rewhet your appetite for familiar operations such as composition and the Visitor design pattern, they'll also open the door to functional programming with Groovy. Think of it as fusion cooking, but with Groovy in the pot."
"In this month's installment of Practically Groovy, I'll celebrate the growth of Groovy by introducing you to the most important changes formalized by Groovy's nifty new parser; namely variable declarations and closures. Because I'll be comparing some of the new Groovy syntax to the classic syntax found in my first-ever article on Groovy, you may want to open up "Feeling Groovy" in a second browser window now."
"The Java platform arguably has made a name for itself as the platform of choice for server-side application development. Servlets have been a strong foothold for server-side Java technology, so much so that myriad frameworks have been built around the Servlets API, including Struts, JavaServer Faces (JSF), and Tapestry, to name a few. As you've probably guessed, Groovy has also built a framework on the shoulders of the Servlets API; however, the aim of this framework is simplicity."
"Many developers who started out using C++ will admit some nostalgia for overload operators such as + and -. Convenient though they are, the polymorphic nature of overridden operators can cause confusion, so operator overloading has been banned from the Java language. The upside of this limitation is clarity: Java developers never have to wonder if the + on two objects adds them together or appends one object to another. The downside is the loss of a valuable shorthand."
"This month, I'll round out the MVC triptych with a discussion of Grails views. Views (as you might guess) are stored in the grails-app/views directory. But there's much more to the view story than the intuitively obvious directory name. I'll talk about Groovy Server Pages (GSP) and give you pointers to many alternative view options. You'll learn about the standard Grails tag libraries (TagLibs) and find out how easy it is to create your own TagLib. You'll see how to fight the ongoing battle for DRYness (see Resources) by factoring common fragments of GSP code into their own partial templates. Finally, you'll learn how to tweak the default templates for scaffolded views, thereby balancing the convenience of automatically created views with the desire to move beyond a Grails application's default look-and-feel."
"The key to incorporating any tool into your development practice is knowing when to use it and when to leave it in the box. Scripting (or dynamic) languages can be an extremely powerful addition to your toolkit, but only when applied properly to appropriate scenarios. To that end, Practically Groovy is a series of articles dedicated to exploring the practical uses of Groovy, and teaching you when and how to apply them successfully."
"This trivial example demonstrates the twin value propositions of Groovy: it dramatically reduces the lines of code you need to write while it preserves the semantics of the Java equivalent. In the next section, you'll explore this idea further."
"If you plan to code in Groovy often, you should look for Groovy support for your IDE or editor of choice. Some editors only support syntax highlighting for Groovy at this stage, but even that can be useful and can make Groovy code more convenient to work with. Some commonly used IDEs and text editors for Groovy are listed in the following sections."
"Around the same time we were looking at this problem, I was following the development of a new language called Groovy (a name that is the language's worst enemy, in my opinion, because I was the one who had to pitch the use of something called "Groovy" to write our translation engine and it was a hard sell because of the name alone). Groovy also can be referred to as JSR-241, which is far more boring, but also much more acceptable in a corporate setting."
"We strongly believe that there is only one way to learn a programming language: by trying it. We present a variety of scripts to demonstrate the compiler, interpreter, and shells, before listing some plug-ins available for widely used IDEs and where to find the latest information about Groovy."
"The Java Runtime Environment (JRE) can host languages other than Java. This flexibility is perfect for non-Java developers who want to work within the contexts of their own languages, while reaping JRE benefits (such as a cross-platform virtual machine with security features). And this flexibility is perfect for Java developers who want to explore the potential of other languages, while staying with the familiar JRE. To illustrate the JRE's language flexibility, this article introduces the Jython and Groovy JRE languages."