8 Jan 2003
(updated 4 Aug 2011 at 18:16 UTC) »
Object Model Array (OMA) Editor.
I am creating a OMA web editor that allows you to add, edit, delete, copy (save as new), move up, or move down an infinite depth tree array. Mostly finished except for the move up and down part.
Infinite depth and recursivity are the hallmarks of great language constructs.
Save, Commit, Rollback.
I am emulating the above within my CSV text db layer. Basically works by making a temp copy of the recordset object requested.
So we have two copies to work with.
The temp copy is only used as a backup.
All temp copies are serialized and cached and not dragged along.
When a save and change occurs to our recordset CSV object the working copy does change and a new temp is made of that new object. The recordset is now locked to the editing end user only, it is still viewable but not editable to others.
So, to the end user the object appears changed but only to them. When they want to commit the changes they become permanent and all related recordset object serialized caches are destroyed. The changes to the recordset object once commited are now present to other end users and unlocked.
On a rollback command we rollback to each previous temp object serialized cache state for our recordset object.
For a discard all or rollback all we discard all changes and all temp objects except the first one which replaces the current active, no changes are saved, and the recordset object is unlocked to editing to other allowed end users.
Now, defining our recordset can be simplistic such as by db.table or smarter by db.table.primary_id_row.
The concept is similar to my db Smart Caching one except it is not for simply caching select recordsets for end users viewing but for end users editing.
This is a simple way to add a transactional quality to small or text type databases.
PRAX is BAX.
I was going over some XML database routines and recalled the PRAX PHP port from Perl and why I didn't like it several years ago.
It is a simple and well done PHP class that handles a XML file as a recordset object of database fields and values. It takes a given XML file with a given XML file node, as a table, and returns a easy to use object to reference that specific XML file node or table as db rows.
The problem was the PRAX record XML objects didn't contain the XML attributes. In my PHP Object dbs I always use properties as a separate table that is associated to my main objects table as row attributes.
For instance, a table for a faq might have lots of attributes such as IP adde, date etc... within the content table, I don't like that. Since these might change I put those parts of a table (attributes) into a separate one and relate them. This way it is easier and quicker to handle a row's property values.
I decided to add that ability to the PRAX lib.