pycase

pycase Developer's Guide

 

Table of Contents

Overview

This is a collection of CASE tools, not yet integrated. Eventually, we can go from abstract model to working code with persistence, GUI's, webservices, etc. Right now, genmodel, genpython, and gensql are the only ones ready to use.

Architecture

genmodel provides the tools to generate an OO E-R model. Eventually that might be built from a graphical case tool (e.g., dia). See test/er_tests.py for examples.

genpython reads that ER model and generates python classes. Can provide persistence via pickle or ZODB. See test/py_tests.py for examples.

gensql reads the same ER model and generates SQL DDL. Currently set up for postgresql, but mechanisms in place to support others. See test/sql_tests.py for examples.

[IN WORK] dia just reads a dia UML model. Want to make this a richer representation of the semantics. Thus do not want to use the std XML objectifiers. Eventually use this to generate the ER model and thus start the code chain.

[IN WORK] postgres.py reads table decriptions. pg2py.py uses this to generate access python code. This was written prior to learning about "object relational mappers". Will try using ORM.

utils.py provides functions to work with XML DOM trees. Am moving to SAX parsers, so this is on its way out.

Edit Cycle

Use unittest-based regression testing, where pass/fail is tested via comparing the test output to a known good "oracle".

  1. cd to test dir. Edit go_ scripts as needed for local conditions.
  2. Add test to basic_tests.py
  3. Run go_test. The new case may fail on compile or run errors. Edit as needed.
  4. Rerun and examine resulting test_... file in testdata dir. Edit code as needed until test output looks right.
  5. At this point the test will still fail due to missing oracle for comparison. Run "approve (name of test)" to promote test output to oracle.
  6. Run again, to get pass.

 
Creator: Harry George
Updated/Created: 2004-10-25