On 29 May 2006, [EMAIL PROTECTED] wrote: On 5/29/06 6:21 AM, Svilen Ivanov wrote: >> I would like to extend RDBO to support versioning of properties for each >> instance.
> I've done this a few different ways in the past. The "safest" way, IME, is > to let the database do almost all of the work, and then do the rest > "manually" on the RDBO side. This requires a database with triggers and > transactions. Here's the setup. The alternative to versioning objects is to remember operations on them. I've done this many times in the past. You need the following operations for a CRUD application: MODIFY (stores old value of field, so you can reverse it) CREATE (reverse with DELETE) DELETE (reverse with CREATE, then every MODIFY) So a table of operations applied to all your objects is your history table. Obviously this doesn't handle foreign keys well. When I did it, I also had the INSERT operation to insert dependents. Advantages: - platform-neutral. RDBO, Class::DBI, etc. will all work with this. - language-neutral, Java and Perl for example can do this equally well. - database-neutral (no triggers) - Ajax-friendly (just POST your operation to the server through some API) - easy to track changes and activity - security can be built in at the "run operations" choke point - a single operations table can track many tables, if you have an operation target ID that maps 1-to-1 to a table row (e.g. I200 is ID 200 in the 'images' table) Disadvantages: - you have to run the operations yourself, you can't just modify a field directly - writing is slower - there's a single choke point for all operations - dependents are hard to track and need special operations - reversing DELETE is not easy if there were dependents I hope this is of interest to some :) Ted ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object