Since GJyve (currently in postgres) uses triggers to maintain data
consistency, I need someway to implement the logic for those databases
that doesn't support server side triggers. In applications where Turbine
is the ONLY interface to the database AND your database has no trigger
support, it is useful to be able to add triggers.
Here's what I have come up with:
Interface InsertListener
{
AfterInsertEvent(BaseObject newObject);
}
Interface DeleteListener
{
AfterDeleteEvent(BaseObject oldObject);
}
Interface UpdateListener
{
AfterUpdateEvent(BaseObject before, BaseObject after);
}
We could add BeforeXXXEvent methods, so that the listener could actually
veto the event at the cost of much more complex client code.
Now to the BasePeer we add the following methods
AddInsertListener(InsertListener listener);
AddDeleteListener(DeleteListener listener);
AddUpdateListener(UpdateListener listener);
RemoveXXListener(...)
Then after the event occurs, just iterate through the listeners.
Any other ideas? I'll be happy to do this, but I am stuck in
Oahu for the week :(
mike
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]