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.