Please read Jython Essentials

2 views
Skip to first unread message

Luby Liao

unread,
May 6, 2012, 12:43:17 AM5/6/12
to cs305-sp...@googlegroups.com
Chapters 8 and 9 for Monday's class.  You should find Example 9-2: jy_counter.py, and Example 9-4. html_browser.pyAn HTML Browser easy to understand.  Let me know if you have questions.  Cheers, Luby


Nicholas Otto

unread,
May 7, 2012, 1:53:38 AM5/7/12
to CS305 Spring 2012
I'm a little confused as to the exact specification as to what a
"bean" is. It is my understanding that a 'JavaBean' is a Java class
written in such a way that Jython can use reflection to access certain
properties associated with certain method names. I'm thinking
specifically in 8.1 when it says "Jython automatically recognizes a
property called propertyName for access if either of the getter methods
—getPropertyName or isPropertyName—is defined. "

Of course there is much more too it than that. But is that the
general idea? Then calling Swing methods and such becomes much more
syntactically pleasing?

Nick

On May 5, 9:43 pm, Luby Liao <lubyl...@gmail.com> wrote:
> Chapters 8 and 9 for Monday's class.  You should find Example 9-2:
> jy_counter.py, and Example 9-4. html_browser.pyAn HTML
> Browser<http://0-proquestcombo.safaribooksonline.com.sally.sandiego.edu/book/...>

Luby Liao

unread,
May 7, 2012, 2:16:02 PM5/7/12
to cs305-sp...@googlegroups.com
Then calling Swing methods and such becomes much more syntactically pleasing?

It is more than that.  For example, with the lingering mystery from the Java Event model, we can nevertheless specify an event callback in Jython.  

The extreme verbosity hurts writability, as the following Wikipedia note testifies:

Having to create a getter for every property and a setter for many, most, or all of them, creates an immense amount of boilerplate code.
 
Cheers, Luby  
--

Join [I Love Taiwan] group
Email:
Visit this group

Reply all
Reply to author
Forward
0 new messages