This book will help Java developers to increase application development and deployment, thus optimizing their overall efficiency.
A brief introduction is provided that shows the differences between Java and Jython, important to include so that the reader will have a better understanding of why their union is beneficial.
The remainder of the book teaches, through examples, how to use Jython. Intended for an experienced Java developer, this book assumes you understand the fundamentals to programming (i.e. loop statements, if.then, etc.). So, page space is focused on utilizing Jython with Java by covering the following: extending Python with java classes, modules, compiling, interpreters, design integration, etc.
www.newriders.com contains all code and applications developed in the book.
I. JYTHON.1. Jython Syntax, Statements, and Comments.
The Interactive Console. Line Separators and Block Indentation Syntax. Comments. Documentation Strings. Statements. Comparing Jython and Java.2. Operators, Types, and Built-In Functions.
Identifiers. Jython Data Objects. Operators. Built-Ins. Comparison of Jython Data Types and Java Data Types. Java Types.3. Errors and Exceptions.
Jython Exceptions. Exception Handling. The raise Statement. Tracebacks. The assert Statement and the __debug__ Variable. The Warnings Framework. Comparing Jython and Java.4. User-Defined Functions and Variable Scoping.
Defining Functions. Namespaces. Recursion. Built-In Functional Programming Tools. Synchronization.5. Modules and Packages.
The import Statement. A Comparison of Jython and Java. Python's package.module Hierarchy. Java's package.class Hierarchy. Reloading.6. Classes, Instances, and Inheritance.
Encapsulation, Abstraction, and Information Hiding. Defining Jython Classes. Jython Class and Instance Attributes. Constructors. Finalizer or Destructor. Inheritance. Method Overloading. Sample Classes.7. Advanced Classes.
Pre-Existing Class Attributes. Pre-Existing Instance Attributes. Special Methods for General Customization. Dynamic Attribute Access. The Callable Hook-__call__. Special Comparison Methods. Object “Truth”. Emulating Built-In Data Objects.
II. JYTHON INTERNALS AND INTEGRATING JYTHON WITH JAVA.8. Compiling Jython with jythonc.
What Is jythonc? Compiling a Module with jythonc. Paths and Compiled Jython. jythonc Options. Java-Compatible Classes.9. Embedding and Extending Jython in Java.
Embedding Jython. Embedding the InteractiveInterpreter. Embedding an InteractiveConsole. Extending Jython.
III. APPLICATIONS WITH JYTHON.10. GUI Development.
Comparing a Java and Jython GUI. Bean Properties and Events. The pawt Package. Examples.11. Database Programming.
DBM Files. Serialization. Database Management Systems. JDBC. zxJDBC.12. Server-Side Web Programming.
Jython Servlet Containers. Defining Simple Servlet Classes. More About GenericServlet. HttpServlet. PyServlet. Cookies. Sessions. Databases and Servlets. JSP.
IV. APPENDIX.Appendix A. Jython Statements and Built-In Functions Quick Reference.