[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1
API and its own server-side templating language; Google App Engine—a “cloud
computing” framework that provides enterprise-level tools for use in Python scripts
and allows sites to leverage the capacity of Google’s Web infrastructure; and Turbo
Gears—an integrated collection of tools including a JavaScript library, a template
system, CherryPy for web interaction, and SQLObject for accessing databases us-
ing Python’s class model.
Also in the framework category are Zope—an open source web application server
and toolkit, written in and customizable with Python, in which websites are im-
plemented using a fundamentally object-oriented model; Plone—a Zope-based
website builder which provides a workflow model (called a content management
system) that allows content producers to add their content to a site; and other
popular systems for website construction, including pylons, web2py, CherryPy, and
Webware.
Many of these frameworks are based upon the now widespread MVC (model-view-
controller) structure, and most provide state retention solutions that wrap database
storage. Some make use of the ORM (object relational mapping) model we’ll meet
in the next part of the book, which superimposes Python’s classes onto relational
database tables, and Zope stores objects in your site in the ZODB object-oriented
database we’ll study in the next part as well.

Rich Internet Applications (revisited)
Discussed at the start of Chapter 7, newer and emerging “rich Internet application”
(RIA) systems such as Flex, Silverlight, JavaFX, and pyjamas allow user interfaces
implemented in web browsers to be much more dynamic and functional than
HTML has traditionally allowed. These are client-side solutions, based generally
upon AJAX and JavaScript, which provide widget sets that rival those of traditional
“desktop” GUIs and provide for asynchronous communication with web servers.
According to some observers, such interactivity is a major component of the “Web
2.0” model.
Ultimately, the web browser is a “desktop” GUI application, too, albeit one which
is very widely available and which can be generalized with RIA techniques to serve
as a platform for rendering other GUIs, using software layers that do not rely on a
particular GUI library. In effect, RIAs turn web browsers into extendable GUIs.
At least that’s their goal today. Compared to traditional GUIs, RIAs gain some
portability and deployment simplicity, in exchange for decreased performance and
increased software stack complexity. Moreover, much as in the GUI realm, there
are already competing RIA toolkits today which may add dependencies and impact
portability. Unless a pervasive frontrunner appears, using a RIA application may
require an install step, not unlike desktop applications.
Stay tuned, though; like the Web at large, the RIA story is still a work in progress.
The emerging HTML5 standard, for instance, while likely not to become prevalent
for some years to come, may obviate the need for RIA browser plug-ins eventually.


778 | Chapter 12: Network Scripting

Free download pdf