||New Reviews| |Software Methodologies| |Popular Science| |AI/Machine Learning| |Programming| |Java| |Linux/Open Source| |XML| |Software Tools| |Other| |Web| |Tutorials| |All By Date| |All By Title| |Resources| |About||
Keywords: Scripting languages, Groovy, Java, Jython, Beanshell, JRuby
Title: Scripting In Java
Author: Dejan Bosanac
Publisher: Addison Wesley
Verdict: A useful introduction to scripting languages on the Java platform
The opening section of the book introduces the whole topic of scripting languages, starting with the thorny issue of how you actually define what is and what isn't a scripting language. This is no easy task, and the first chapter goes into detail about static versus dynamic typing, compilation versus interpretation and so on. For those new to the topic it's a solid introduction to the fundamentals of dynamic language features which underpin most of what are commonly called scripting languages. The following chapter goes further and looks at a number of scenarios where scripting languages make sense, including shell languages, application customisation and automation, prototyping and so on. This chapter gives a first glimpse at a range of scripting languages, from Unix shell scripting to Perl, Python and even VBA (Visual Basic for Applications).
For those who've never come across it, Groovy is a dynamic programming language that's designed from the ground up to be familiar to Java programmers and that makes it possible to mix and match classes from Java and Groovy together. The Groovy chapters provide a pretty good introductory tutorial, though it should be noted that Groovy In Action remains the definitive guide to the language and is still recommended for those who really want to get into it.
The Bean Scripting Framework rounds out the end of section two of the book. BSF is a Java framework that enables you to combine code from different scripting languages in one place.
Part three of the book moves into more advanced topics and looks at scripting in practice, mostly using Groovy or Beanshell for the examples. There is discussion of how you use scripting for unit testing, shell scripting, debugging and build automation (i.e. how to supercharge Ant). A chapter is also devoted to showing how you would use scripting languages to implement a range of software design patterns.
The final couple of chapters make up the fourth section of the book. The first of these looks at the Java Scripting API (JSR 223), which sets out to create a standardised platform for scripting languages, with particular reference to the web language PHP. This is still in development, but the chapter walks through both the motivations and the practicalities of how it works. This is followed by the tenth and final chapter, which looks at the Web Scripting Framework, which takes things even further and adds scripting language support to dynamic web pages (JSP).
To be honest the final part of the book could almost be considered an appendix, alongside the real appendices which cover Groovy installation, IDE support and installation of JSR 223. The core content of the book is in the first three sections, which really focus on the introduction to scripting and the more detailed examination of Groovy and, to a lesser extent, Beanshell.
The writing is a little on the dry side, with something of an academic tone at times, which is a pity because this is a topic that is dynamic, interesting and fun. For this reader at least, more emphasis on some of the other scripting languages, such as Jython and JRuby would have been preferable to the chapters on the Scripting API and the Web Scripting Framework. However, on the whole this is a good read, particularly for those readers who are coming to this for the first time.