XML technologies / XML / Python & XML / Python and the design of distributed systems / Understanding the scope
(Excerpt from "Python & XML" by Christopher A. Jones & Fred L. Drake, Jr.)
This sample application is the most demanding example presented in this book so far. It is therefore a good idea to prepare a checklist and an overview of the components and their relationships.
The application can be built on one computer, but all its different components must be installed there. Ideally, using two computers would be a better approach. Either way, these are the five components involved:
A simple relational database with a single basic table. We used SQL Server, but MySQL or Postgres should work just as well.
Data access object. This native Python class encapsulates the SQL database’s data behind an XML-friendly interface.
An XML data store. This is a flat file you create, coupled with an object that provides access to the data using XML for input and output.
The XML-Switch. The XML switch itself is an interpreted, Python-based mechanism for XML routing and object brokering. Once loaded with a routing table, it could examine an incoming XML SOAP packet using XPath and determine its next destination. It could send a SOAP packet anywhere, for example to a web server. In this example, the switch uses XML messages as RPC calls to the objects it hosts.
Web/CGI application. This is a Python-based CGI script with an accompanying web page, similar to earlier CGI scripts in this book. It should run on any web server (IIS, Apache) configured for CGI.
The source code used in these examples is intended as a starting point for learning. It lacks the error handling and robustness needed for direct use in applications. This section should be viewed as a practice design demonstrating various techniques for many of the tasks required when integrating distributed systems with XML.
Copyright © 2002 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "Python & XML" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top