At 01:38 PM 7/1/2001 -0700, haaserd wrote:
>I looked over Generate.py and DataTable.py a bit.  Seems like whatever data
>DataTable.py is trying to provide should be captured earlier by 
>Generate.py and placed in a module in the GeneratedPy/ directory.  This 
>would eliminate the problem of trying to open Classes.csv with a relative 
>address, make the

The problems of importing the MK-generated classes and opening the .csv are 
similar. In the first case, you must put the classes where they can be 
found or augment PYTHONPATH/sys.path. In the second case, you must specify 
a valid path (whether you prefer relative or absolute is your choice).

There might be a shift here, but there wouldn't be less to consider and 
configure.


>operation slightly faster as Classes.csv is not cacheable and the Python

Any .csv is cacheable by simply keeping the data in memory (such as an 
instance of DataTable). In this particular case, MK creates a series of 
Klass and Attr objects (found in MiddleKit.Core) which are in fact cached 
in memory for the lifetime of the model (which is typically the lifetime of 
the store that uses the memory). The .csv is thrown away as it is merely a 
means to convey the model. Other means such as XML could be introduced in 
the future without disturbing the rest of MiddleKit.

Perhaps it could make start up faster if the Model was pickled to disk and 
read in lieu of the .csv spec provided the .csv date was older. I've added 
that to the TO DO list as a potential optimization.


>module would be, and eliminate a potential problem where users (such as 
>me) update Classes.csv as thoughts occur and re-generate only when no 
>further testing can be done with the current data structure.

Is there any reason not to generate after editing the .csv?

If there is, you might consider a separate file for your thoughts which you 
then copy over before generating. Of course, you can make a little script 
to do the copy and the generate:

#!/bin/sh
# gen
cp Classes.csv Classes.bak
cp NewClasses.csv Classes.csv
python path/to/MiddleKit/Design/Generate.py --db MySQL --model MyApp.mkmodel


Then just type this when you want:
 > gen


Hope that helps.


-Chuck


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to