Jython Essentials: Rapid Scripting in Java

Jython Essentials: Rapid Scripting in Java

by Samuele Pedroni, Noel Rappin PH.D.
     
 

View All Available Formats & Editions

Jython is an implementation of the Python programming language written in 100% pure Java, so it runs under any compliant Java Virtual Machine. The secret to Jython's popularity lies in the combination of Java's librariesand tools with Python's rapid development capabilities. With Jython, you can write Python programs that integrate seamlessly with any Java code.

Overview

Jython is an implementation of the Python programming language written in 100% pure Java, so it runs under any compliant Java Virtual Machine. The secret to Jython's popularity lies in the combination of Java's librariesand tools with Python's rapid development capabilities. With Jython, you can write Python programs that integrate seamlessly with any Java code. And like Python, Jython can be used interactively, so you can get immediate results as you are programming.Jython Essentials provides a solid introduction to the Python language, offering a brief but thorough tour of the Python concepts you'll need to understand to use Jython effectively. The book makes frequent comparisonsbetween Python and Java, with special emphasis on the different object-oriented semantics of the two languages, so Java programmers can quickly get up to speed with Jython.Jython Essentials also covers the various ways in which Jython and Java can interact. For example, Jython code can create instances of pre-existing Java classes and call methods in those instances. You can write Jython classes that are direct subclasses of existing Java classesand use introspection to discern the capabilities of JavaBeans components. This book provides examples of using Jython with existing Java libraries, including the Swing GUI toolkit, the JDBC database API, the Servlet API, and various XML tools. And finally, the book shows howJython can be used as a scripting language within a Java program.With Jython Essentials, you have everything you need to start creating applications that mix the best of Python's interactivity and Java's robust libraries.

Editorial Reviews

bn.com
The Barnes & Noble Review
What if you could leverage Java's wide reach and powerful enterprise-quality tools for GUI, database, and XML development -- while writing up to 50 percent less code and gaining the productivity and simplicity of scripting? That's what Jython promises and Jython Essentials delivers.

Jython is a complete Python implementation written in 100 percent pure Java and seamlessly integrated with the Java platform. While occasionally a bit slow, it lets Python go just about anywhere Java can go -- into client-side applets that run in browser JVMs; into servlets that run on Java servlet or J2EE servers; into .jar files that can be deployed to multiple platforms. It also gives developers a simple and powerful tool for extending their Java programs and accomplishing tasks that require just too much overhead in Java.

Jython Essentials begins by comparing Python types, structures, and object-oriented features with the nearest Java equivalents; showing how to combine Python statements into functions; explaining how to create reusable Python modules; and introducing good Python programming style. Next, the authors demonstrate the diverse ways Java and Jython can work together. Jython's goal is to make those interactions as transparent as possible; still, there's much to learn.

Coverage includes using existing Java objects and classes from within Jython; automatic type conversions between Java and Python types; creating Jython classes that are direct subclasses of existing Java classes; and introspection shortcuts that evade Java's getSomething and setSomething methods. You'll learn how to use Jython with key Java libraries such as Swing and JDBC; with key Python system, file, and serialization modules, and with Python's PyUnit unit testing framework. The authors conclude by showing how to use Jython as a scripting language within a Java program (very handy for preference/properties files); and how to compile Jython code for distribution.

Jython is a terrific tool, and this book introduces it extremely well. (Bill Camarda)

Bill Camarda is a consultant, writer, and web/multimedia content developer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Product Details

ISBN-13:
9780596002473
Publisher:
O'Reilly Media, Incorporated
Publication date:
03/28/2002
Edition description:
2002
Pages:
302
Product dimensions:
5.90(w) x 8.80(h) x 0.70(d)

Meet the Author

Samuele Pedroni is one of the main Jython developers. He holds a CS flavored diploma in mathematics from the ETH Zurich (Swiss institute of technology in Zurich). He is now a teacher and research assistant at the Institute of Theoretical CS. He plans to come to the US for a PhD in the field of dynamic languages and dynamic compilation. He came to Jython with the interest in improving it with respect to Java importing and reloading. He has developed several important patches related to java integration, classloaders, and the reworking of java/python importing rules and design.

Noel Rappin has a Ph.D. in computer science from the Georgia Institute of Technology, where his research included methods for teaching Object-Oriented Programming and Design. He has extensive production experience in both Java and Python. Noel also contributed an introductory chapter to the book Squeak: Open Personal Computing and Multimedia (PH).

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >