Odyssey 3 Application Structure

This page explains all the pieces required in order to implement an application that uses the Odyssey framework.

Source Tree

Each application has a source tree rooted at svn+ssh://odyssey@core.cs/u/odyssey/svn/odyssey/[application].

Within this directory, there is a directory trunk containing the mainline of development on the application. There may be branches and tags directories as per Subversion (SVN) guidelines.

Within the trunk directory there is an sql directory containing SQL schema definitions and a python directory containing Python code.

Python Code

The Python code for each application follows typical Python packaging conventions. Typical subdirectories may include:

  • db — files containing database interface procedures
  • webui — files containing web user interface implementation

The whole directory is included as an SVN external in svn+ssh://odyssey@core.cs/u/odyssey/svn/odyssey/uwcode/trunk/python/uw/local. This means that applications can access each others’ code by importing the appropriate Python module named uw.local.[application].….

SQL Schema Definitions

The SQL schema definition for an application is broken up into a number of files. There is always an init.sql file; executing this file as the appropriate Postgres user will create the schema corresponding to the application and assign appropriate role permissions, all within a transaction.

The init.sql file in turn includes init_data.sql, init_view.sql, and init_perm.sql. These are repsonsible for creating all objects in the schema:

  • init_data.sql — Creates all tables (and sequences). In particular, the objects created here are the ones which, if dropped and re-created, will have lost something (in particular, the data stored in the tables; current value of sequences).
  • init_view.sql — Creates all non-data-holding schema objects, including views and functions. The important distinction here is that these objects can be dropped and re-created in a working database without losing anything.
  • init_perm.sql — Assigns all role permissions. Does not create the roles themselves; that is done manually.

-- IsaacMorland - 05 Nov 2008

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2008-11-05 - IsaacMorland
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback