Jump to: navigation, search

GEPS 010: Relational Backend

46 bytes added, 13:22, 8 April 2009
New db backend for GRAMPS
I don't understand the use of '''slots''' in the above. How is that idea related to db access? --[[User:Dsblank|Dsblank]] 11:14, 26 March 2009 (UTC)
Doug, I meant '''properties'''. The idea is the following. In gen/person an person address contains all secondary objects and all references. In a database, this depends on the implementation. So bsddb has a flat table with the person object in one table. So one get. For sql, the secondary objects will be in other tables. Hitting all relevant tables on get of a person would be stupid. We only need to access the tables when the data is needed. In, a person is obtained with get_person_from_handle. This fills up a Person() object. uses the unserialize method to do this. My suggestion of slots properties would be that with an sql backend, the handle is setget, but all the other Person attributes are properties that remain None. If data is needed, the getter checks if value is None, if so, the sql database is hit, otherwise the data is just returned. Just an idea, the concept needs to be worked out. The alternative is changing /gen/lib dramatically, but I don't see the benefit of that. Note that making all objects in /gen/lib new style classes with slots would be a good move nonetheless.[[User:Bmcage|bmcage]] 13:22, 8 April 2009 (UTC)
== Extending ==

Navigation menu