99% of Gargoyles ... : look like Bob Todd
Updated: 15/06/2002; 5:27:07 PM.

 

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Thursday, 9 May 2002

There is a new release of PythonCard coming out this week, lots of interesting new goodies ...

Meanwhile I'm struggling with a way to come up with transparent persistent storage in an easy to use desktop development environment. The existing flatfileDatabase sample is my starting point. In it Kevin takes a Model-View-Controller approach to storing fairly standard address records in a text file. The storage approach is fairly forceful, it simply saves the current record when you navigate out of it, but it should prove an interesting test bed for integrating other storage mechanisms. Top of my heap are shelve and MySQL.

What I need to do is implement a generic storage mechanism. Inspired by the contents of weblib and bdoz how is this for a first stab at a super class definition;

class Storage:
    def open(self):
        "Initialise this storage object"
        pass
    def store(self, table, **row):
        "Store an item"
        pass
    def fetch(self, table, id):
        "Fetch an item by its key"
        pass
    def find(self, table, where):
        "Find an item by a non-key value"
        pass
    def delete(self, table, id):
        "Remove an item permanently"
        pass
    def _insert(self, table, **row):
        raise NotImplementedError
    def _update(self, table, **row):
        raise NotImplementedError

The stored items would be passed arounds as dictionaries I think. This makes interfacing with ZODB and shelve quite easy and is quite analagous for us RDBMS types.

I think I will let this kick around in my subconscious for a bit before I actually get off my bum and try and implement it.


comment()   5:24:00 PM    


© Copyright 2002 Andy Todd.



Click here to visit the Radio UserLand website.

 


May 2002
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Apr   Jun

Top Blogs
Mark Pilgrim
Kevin Altis
Dan Shafer