Doug,

Have not played too much with triggers myself, but I believe you could do this: define a private method with codemode=objectgenerator and within it, manipulate the %class object to insert a new trigger (see the documentation of the %Dictionary package, specifically ClassDefinition and TriggerDefinition). You have to Do %class.Save() for this to work.

Given that you're only using the method as a mechanism to generate the trigger, the method body itself could be empty (this is also why I recommend making it private).

I tried this myself a couple of days ago trying to automate the generation of proxy classes - e.g. being able to create a new class with a private reference to an object of another class, both classes have the same interface and the proxy forwards all method calls to the "subject" reference. Still haven't tackled properties though.

However, I don't know if this will work without nasty side effects. What you could do is define this functionality in a separate class and perhaps have it generate the triggers for you, i.e. instead of having this into your MSAccessBase class, do it in another class that manipulates the MSAccessBase hierarchy. I think you can instruct Cach� to always compile this class after the MSAccessBase and subclasses are compiled, but haven't used this myself and don't know how good it is.

HTH,

Ram�n

--
ZCacheLib - Open Source Extensions for Cach�
http://www.zcachelib.org



Reply via email to