All things Jythonic 2004/8

August 2004
2 3 4 5 6 7 8

A blog tracking jython developments

XML-Image Syndication

XML-Image Comment Feed

Letterimage Contact me


deque collection class for Jython

Raymond Hettinger  provided a Pure python drop in replacement for collections.deque() from Py2.4 and it works with Jython.  Hurray!  Its available at the ActiveState Python Cookbook.  See the Python 2.4 documentation at: for how to use this. 


posted at 13:14:40    #

Some Python Aspect Oriented Programming Links

Python Aspect Oriented Links:

 This introduces a Python module which implements one essential concept in Aspect Oriented Programming (AOP)... The aspects module provides a function called wrap_around.

 The Pythius package high level AOP support. See here for examples.

aspects is a python module that enables Aspect Oriented Programming in Python. For now, it provides a set of ready-to-use aspects and an easy way to create your own aspects. The current possibilities are still a bit limited, but it will soon provide a more exhaustive way to define and use more complex aspects.

Most readers are already familiar with the concepts of object-oriented programming: inheritance, encapsulation, polymorphism. But the creation of objects of a given class, with certain parents, is usually thought of as a "just so" operation. It turns out that a number of new programming constructs become either easier, or possible at all, when you can customize the process of object creation. Metaclasses enable certain types of "aspect-oriented programming," for example, you can enhance classes with features like tracing capabilities, object persistence, exception logging, and more.

As far as I can see only Lightweight Python AOP seems to work with Jython.  I was able to successfully run the tracer example with Jython although the timing example failed but not in the aspect library code.  The other libraries require Python 2.2 or greater which currently eliminates Jython.


If you are new to Aspect Oriented Programming, here is a quick definition:

Aspect Oriented Programming (AOP) is a technique for separating and isolating crosscutting concerns into modular components called aspects. A crosscutting concern is a behaviour that "cuts" across the boundaries of assigned responsibility for a given modular element. Examples of crosscutting concerns are process synchronization, location control, execution timing constraints, persistence, and failure recovery. There is also a wide range of algorithms and design patterns which are more naturally expressible using AOP.

-Christopher Diggins, Aspect Oriented Programming in C++, August 2004, Dr Dobbs Journal
posted at 03:08:48    #

Why I Use Jython - Run Darn Near Everywhere

I've just putting the finishing touches on several small projects that are centered around Jython and several widely available java libraries.  I chose Jython for several reasons. 

  • Python just fits how my brain works. Weird I know, but that is my reality.
  • But not everyone has Python installed, or has the right release of python.
  • So I write my software in python that I can compile into a java jar using Jython and thus piggy back on the general availability of the Java platform! 
  • So my software is easily deployed!
posted at 14:10:08    #
Creative Commons License
This work is licensed under a Creative Commons License.