At 12:38 PM 10/2/2001 +0200, Thomas Kumlehn wrote:
>I want to transform an SQL-only application to a
>MiddleKit python based one. Some of the already
>existing tables heavily use the set(..) feature of
>MySQL for all kinds of flags.
>Note: It's internally stored as a bitfield of up to 32
>named boolean switches and has a similar syntax to
>enum(..)
>
>My Question:
>
>Would you suggest to add a new AttributeType to
>MiddleKit to match those existing structures?
>It'll become a dictionary of booleans and with SQL
>engines that don't support SET(..) it could be stored
>as a group of boolean fields, sharing the same name
>prefix.
>
>Or is it better to keep the python side simple and
>convert these tables to others with lots of single
>boolean fields that are compatible to the established
>persistent techniques ?
>
>
>Maybe someone else has thought about this before or
>even did it ?

I developed MiddleKit by starting with a couple basic attributes and adding 
new ones in as I fleshed it out. I also strove for allowing you to add 
attributes from the outside without having to modify the code, but I don't 
think I have a test for that and I haven't done it.

I think you could take either approach and be successful. Should you decide 
to create a new attribute type, I recommend that you pick two examples like 
IntAttr and ObjRefAttr as examples to parallel as you build your own FooAttr.

Initial success would probably be easier if you just put FooAttr and its 
supporting code in MiddleKit directly. Once you have it working, we can 
figure out how to make it a separate FooAttr package that can exist 
independently.

In the MiddleKit directory, you can use:
         grep -ln IntAttr */*.py
         grep -ln ObjRefAttr */*.py

To get a list of files to examine.


-Chuck


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

Reply via email to