O’Reilly news

Rapid Scripting a la Python in Java: O'Reilly Releases Jython Essentials

April 9, 2002

Sebastopol, CA--History teaches us that the combination of two fundamentally valuable substances can produce yet another substance that is also of value. Steel, which is made by adding a small amount of carbon to iron, has turned out to be a rather nifty metal. Which does not imply that iron and carbon are not useful on their own. Man's use of iron tools ushered the end of the Stone Age. And carbon--in combination with other elements--forms the basis for life. It also makes good pencil lead. In programming circles, we have Jython: an implementation of the Python programming language written in Java.

"Jython is an increasingly important target platform for client and server side applications with a wide range of powerful existing tools," explains Noel Rappin, coauthor with Samuele Pedroni of Jython Essentials (O'Reilly, US $24.95). "Jython offers an alternative to the Java language for using these tools, offering shorter programs that are easier to write, read, and maintain. Using Jython can cut development time significantly."

As Pedroni and Rappin explain, Jython combines a scripting language of unparalleled ease of development with an operating environment for which many powerful tools have been written. The combination can be immensely valuable for programmers, enabling them to cut development time significantly while still retaining the ability to use existing Java tools, such as applets and Servlets. Just as Python was originally conceived as glue to bind together other programs, Jython acts as glue to help developers get the most out of Java-based tools. In particular, Pedroni and Rappin assert, Jython excels at simplifying the use of complex Java programming libraries and APIs, such as the Swing graphical interface toolkit or the JDBC database connectivity API.

"The subject matter is important to programmers who want a choice of languages when dealing with Java Virtual Machine," says Rappin. "By offering this choice, Jython makes the JVM more powerful and more valuable to its developers."

"While the one platform, one language approach has its advantages and appeal," Pedroni adds, "Jython doesn't want to replace Java, but to integrate with it. The right point of view is to imagine Unix with only C, without Perl and Python, and think whether that would make sense."

Jython Essentials provides a solid introduction to the Python language, offering a brief but thorough tour of Python concepts necessary to use Jython effectively. The book makes frequent comparisons between Python and Java with special emphasis on the different object-oriented semantics of the two languages.

The book also covers the various ways in which Jython and Java can interact. For example, Jython code can create instances of preexisting Java classes and call methods in those instances. Programmers can write Jython classes that are direct subclasses of existing Java classes and use introspection to discern the capabilities of JavaBeans components. Jython Essentials provides examples of how to use Jython with existing Java libraries, including the Swing GUI toolkit, the JDBC database API, the Servlet API, and various XML tools.

This book was written for Java programmers who want to learn Jython to be more productive with the tools they already know, or to add scripting capabilities to existing programs. Readers will also include Python programmers who want to use Java tools without giving up the productivity gains of using Python. Regardless of their background, developers will find everything they need to start creating applications that mix the best of Python's interactivity and Java's robust libraries in Jython Essentials.

Online Resources:

Jython Essentials
By Samuele Pedroni and Noel Rappin
ISBN 0-596-00247-5, 277 pages, $24.95 (US), $38.95 (CAN)
order@oreilly.com
1-800-998-9938; 1-707-827-7000

About O’Reilly

For over 45 years, O’Reilly has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through the company’s SaaS-based training and learning platform. O’Reilly delivers highly topical and comprehensive technology and business learning solutions to millions of users across enterprise, consumer, and university channels. For more information, visit www.oreilly.com.

Email a link to this press release