javaclass

Changeset

145:904c1223e3aa
2005-01-23 Paul Boddie raw files shortlog changelog graph Added notes about dispatcher methods.
docs/index.html (file)
     1.1 --- a/docs/index.html	Sun Jan 23 01:01:25 2005 +0100
     1.2 +++ b/docs/index.html	Sun Jan 23 01:01:34 2005 +0100
     1.3 @@ -171,6 +171,19 @@
     1.4      people might start advocating decorators at this point, but not everyone
     1.5      is running the very latest stuff from python.org, and decorators won't
     1.6      help you target a specific specialised method anyway.</li>
     1.7 +  <li>Special dispatcher methods are often generated for the benefit of
     1.8 +    Python access to Java classes, even though such methods are not strictly
     1.9 +    necessary for the Java classes to work amongst themselves. Such methods
    1.10 +    are only generated when many methods of the same name reside in a given
    1.11 +    class, since where Java distinguishes between them on the basis of the
    1.12 +    signatures, Python permits only one method of a given name and needs
    1.13 +    additional logic to dispatch to the actual method implementations on the
    1.14 +    basis of the types of the incoming values. The implementation of the
    1.15 +    dispatcher method is naive and does not try to order the type checks and
    1.16 +    dispatches according to the specificity of the parameter types; thus, a
    1.17 +    more reliable but more verbose way of ensuring that the correct method in
    1.18 +    such cases is called from a Python program may be to use the special long
    1.19 +    method name (eg. <code>setValue____I_</code>).</li>
    1.20    <li>Imported and translated bytecode is not written out or cached. This
    1.21      means that a fair amount of work happens every time you need to import
    1.22      Java classes, although the generation of .pyc files could be introduced