Quantax Spotlight
Zope Case Study: Quantax�
Professional
COMIT Gruppe, Switzerland
Introduction
Quantax Professional is a rather unusual application of Zope: No predefined content is published, but financial analyses are calculated based on trading data maintained in a complex database.
This case story introduces Quantax Professional and its market and shows why Zope and Python provide a unique cost advantage.
The trading and risk management Quantax Professional
Asset and Portfolio managers, small and medium sized trading units of banks, and corporate treasuries utilize Quantax Professional as a complete trading system. With the consolidation of all frequently dealt financial instruments and the systematic handling of all risk factors, even the most demanding users are satisfied.
In addition to the total overview of risk and performance over dynamically defined portfolios, Quantax Professional enables drill-down to transaction level as well as �slice and dice� analyses of any structures and assets.
Customized reports can be developed easily; even outside the system (e.g., in Microsoft Office�), with data delivered to ethem in real time.
Quantax Professional is not a typical Zope application, in
that no predefined content is published. Instead, complex data
from a database of financial trades is analyzed and presented.
The following screenshots do not have much in common with
classical web publishing. They show the use of Zope as a
complete application server:
Quantax Professional offers a general overview of a dynamically defined portfolio with "drill-down" to each single transaction.
Market and competition
Quantax Professional is positioned in financial trading (treasury, trading floors, risk management), a market that is already occupied by big players. These are expensive systems (typically 0.3-1.0 million EUR/USD), which are typically set up on a relational database, a Unix server, and some middleware. These systems are often outdated and not very flexible. Even in investment banking, cost cutting is en vogue; maintaining and integrating old systems is often too expensive.
To find itself a market niche, Quantax Professional must cover a major part of the big systems� functionality and provide higher flexibility, yet at a fraction of their costs. This is only feasible with open source components and a powerful development environment.
Zope fits these requirements exactly; as a web-based environment it does not require any expensive client installation. Furthermore the customer can offer the service to its external clients over the Internet.
Design criteria
Our main design goal was a low Total Cost of Ownership: Low license costs as a result of inexpensive development, low costs for hardware and base software due to open source components, low maintenance costs because only components are used that do not require specialists for their administration.
While classical client-server systems use different layers of standard systems (OS, databases, middleware, etc.) that all have to be maintained in coherent lock step, Zope integrates a web server, an application server, a database, and some middleware (ORB) connecting them. All these components are fully transparent to the application and therefore do not require special consideration (and hence maintenance) in the application code. The persistence mechanism, for example, is maintaining financial deals objects and all objects referenced by them, all without a single line of code for persistence or database access.
Python as the development language
For inexpensive development, one simply cannot beat a fully interactive environment. Each procedure and each statement can either occur in a program (or script) or can be executed ad-hoc directly on the �console.� Therefore, testing each single line of code even before it forms a program is possible and indeed very useful (�writing the tests before the program� is a central maxim in "eXtreme programming"). In other environments, the quality of such "pre-tested" programs can only be reached with extensive testing later on.
The data structures built into Python (sequence, dictionary) are flexible and omnipresent, so that the same structures and idioms ("patterns") can be reused all over. They do not have to be constantly re-invented, modified, adapted, checked, or documented.
Python is (like Java) byte-code interpreted, which may cause a certain loss of performance. Therefore, Zope uses modules coded in C for some core services. We did not need to write any further C programs, although they could be integrated easily if ever so required.
Zope: User interface and database
While all Quantax Professional business logic is programmed in Python, Zope handles the user interaction and data storage.
As mentioned above, the object-oriented database ZODB provides a fully transparent persistence mechanism. A number of logical databases are maintained independently and are coordinated by the built-in transaction mechanism. The isolation between users and their correct assignment to a session is also performed transparently to the application.
The following facilities of Zope are used extensively in the user interface:
- User administration and access control: Each user must identify him or herself and is assigned a role. The role controls the access to pages and application functions.
- Arbitrary, but controlled embedding of Python code in HTML pages.
- Simple generation of table displays from sequences and dictionaries, including sorting and pagination.
- Forms call processing functions automatically. All entries in Quantax Professional are made through forms.
- Form fields are automatically passed into Python functions as dictionary arguments.
Experience
The following characteristics of development and therefore of the resulting product have convinced us that we have made the right choice with Zope:
- Transparency: The application code can concentrate on business logic, as database handling and user interface representation is taken care of.
- Interaction without Java and JavaScript: The complete user interaction is done through HTML forms, without any use of cookies, Java, or JavaScript. This leads to a high level of browser independence. Moreover, the application can be called easily from Microsoft Excel� Web-Queries, or from any other application that can invoke a URL.
- Openness: The decoupling of display and content as well as the readable URLs allow the user to assemble Quantax Professional displays to form customized portals (this may also be done outside of Zope; e.g. by using Macromedia Dreamweaver� or Microsoft FrontPage�).
The power of Python combined with the flexible table display of Zope provide for very simple data analyses based on hypercubes (known as pivot tables in Microsoft Excel), which are otherwise only available in significantly more complex OLAP tools.
Size
We conclude with a some statistics on size of the Quantax Professional and the number of Zope objects used:
Component |
Count |
Python Packages |
9 |
Modules |
185 |
Classes |
281 |
Methods |
1�400 |
Functions |
481 |
GUI Pages and Forms (DTML) |
579 |
Online Documentation Pages (DTML) |
53 |
Contact
COMIT Gruppe
RAS
Pflanzschulstrasse 7
CH-8004 Z�rich
[email protected]
www.quantax.com