April 24, 2007
Greetings Software Enthusiasts!
Introduction to Jython
...with Jim Baker
This month, we have Jim Baker with us to help us learn about Jython. What is Jython?
Django is a popular web application framework written in Python that is often compared to Ruby on Rails (RoR). Like RoR, Django enables developers to quickly build high-performance web apps with a robust database backend. But many web apps have needs that go beyond this standard three-tier configuration, even as enhanced with load balancing and caching. Or they have specific libraries they need to access. Because of these requirements, developers have turned to Java Enterprise Edition and related solutions, albeit at a higher development cost. But is it possible to combine the benefits of both?
Django on Jython is such a solution. By combining the time-to-market advantages of Django with the heavy-lifting capabilities of the Java platform, developers get the best of both worlds. Jython is an implementation of Python that runs on the Java Virtual Machine (JVM) via bytecode compilation. It can therefore readily interoperate with existing Java code, while also taking advantage of the Python ecosystem. This includes Django: as committers on the Jython project, we have recently added support for Django to the trunk version of Jython, and we plan to enhance this for the forthcoming release of Jython 2.5 this year.
In this talk, we will begin by introducing Django, as well as basic Python functionality. Jython, like other Python implementations, supports an interactive object shell. (This is a familiar concept to users who have worked with Lisp, Ruby, or Smalltalk, and it is a hallmark of a dynamic language.) This is powerful stuff. We can create a new Jython class that extends a Java class on the fly; or call methods on Java objects; or work directly with Django's object-relational mapper. In fact, all of Django's functionality is available from the object shell. To complement Django, we will look at one popular module for Python, dateutil, that provides easy-to-use date and datetime support, including generic parsing, iCalendar recurrence rules, and relative deltas, such as the last week of month for a given date.
Of course, the object shell is just a tool for developers. Similar to the servlet API, Python web app frameworks have adopted a common API called WGSI. The modjy component provides a mapping between WGSI-supporting servers on Jython and servlet containers for Java. We will show a couple of examples of various open source stacks that can be used with DoJ, including Tomcat, MySQL, and PostgreSQL. Indeed we expect to see many more databases to be supportable by DoJ because of the leverage JDBC provides.
Then we will look at how two popular Java open source projects can be harnessed to Django by running it on Jython. The first is iText, which supports parsing and generation of PDF documents, as well as more specialized functionality like form filling. Outside of the Java ecosystem, there's only limited support in Python for PDF; the ReportLab toolkit is popular, but the open source version does not support PDF reading or form filling for example. We will show how you can use Django on Jython to automatically publish standard IRS 1099 forms.
Django supports using memcached for distributed caching. memcached is a proven solution, powering the scalability of such web sites as Flickr and Wikipedia. However, memcached only support short string keys with binary objects (Django stores objects through pickling, which is Python's own object serialization mechanism). The Java ecosystem provides a range of other options. In particular, Terracotta provides strong support for distributed computing. This works particularly well within the context of an Ajax-architected application running on Django, as we will show.
Web app development needs to be responsive to the rapid development cycles that are increasingly required. Django is a powerful solution for that. By combining it with Jython, developers can also take advantage of the Java resources they would otherwise miss out on.
Speakers bio:
Jim Baker has over 15 years of professional software development experience, focusing on business intelligence, enterprise system management, and high-performance web applications. He co-founded both Empact Solutions (raising $10M in VC financing) and BizLogix. Jim also leads the Front Range Pythoneers, the Boulder Python Users Group. An Orlando native, Jim is a graduate of Winter Park High School in Winter Park, Florida; Harvard College, A.B., Computer Science magna cum laude; and Brown University, Sc.M., Computer Science (and an all-but-dissertation Ph.D. candidate). Jim is a Jython committer. An Orlando Science Center summer class introduced Jim to programming when he was 11, and he has been working with Java since 1995.
PS - Check out the calendar for other events...
|
| Agenda: |
| 6:00pm - 7:00pm: | Networking |
| 7:00pm - 8:30pm: | Presentation, Questions/Discussion |
| 8:30pm - ?: | Networking |
|
Host: DeVry University - Orlando campus
Meeting Sponsored by: Cambridge Web Design Inc ::: Working software developers
Room: 105
4000 Millenia Boulevard
Orlando, FL 32839
Map
407 345 2800
RSVP: Please respond to rsvp (at) orlandojug (dot) org so that we can estimate the number of people attending the meeting.
|
Other Groups:
|
|
|
|
|