Today my topic is persistence in object oriented languages. In a vain attempt to get someone (anyone) to link to this Radio blog I making this category a notepad of my experiments to add persistence to PythonCard.
My first task is to build an application that talks to a relational database. Hey, I've done that already. dbBrowser is a sample that ships with PythonCard. Tick one.
My second task is to integrate the relational storage with events in the framework. The purpose here is to make the storage as transparent as possible. dbBrowser is read only and doesn't address this issue. The code is modular though, with different modules for the different 'flavours' of database that it talks to.
For this step I'm going to stick to a single database and concentrate on keeping the application data model seperate from the persistence mechanism. In other words, if I do this correctly you should be able to swap out the database and replace it with another without changing any of the application code, as well as using the persistence mechanism with any PythonCard application. Of course, if I do it really well you should be able to replace the relational database with any other form of storage, in particular ZODB or shelve. I'm leaving them out of it until I have a working model with a relational database. I'm also leaving them alone for now because other people are working on object storage in PythonCard. Hopefully we will all progress together and be able to join our efforts in the near future.
For step two I will need to build another application. Luckily, I've got one in mind. I've even got a relational data model to go with it. In my next post I'll try and explain my sample application.
1:07:03 PM
|