Open main menu

Gramps β

Changes

GEPS 017: Flexible gen.lib Interface

339 bytes added, 18 February
m
Protected "GEPS 017: Flexible gen.lib Interface": withdrawn no edit to be done as historical ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
{{man warn|This proposal has been withdrawn.|'''Update''': After building a [[Media:prototype.tar.gz|prototype]], it was found to be too slow for general use. Rather, it seems to be better to cache the data as it appears when it comes from the BSDDB database (pickled, serialized versions of gen.lib objects).}}
 
gen.lib is the Python interface for all of the objects in Gramps. Currently, it is not directly tied to any data storage mechanism, except for the implicit assumption that objects are created through an unserialize method for each object.
This proposal explores the possibility of making the creation of objects more general, and less tied to the particular unserializing process.
'''Update''': After building The prototype uses a [[Media:prototype.tgz|prototype]]combination of Delayed evaluation, it was found to be too slow for general use. Rather, it seems to be better to cache the data as it appears when it comes from the BSDDB database (pickled, serialized versions and removing of gen.lib objects)' properties. ThusWhen a property was accessed, the delayed object was evaluated, this proposal has been withdrawnand the set to the attribute.''
= Overview =
self._engine = EngineKeeper.get_instance().engine
Note that above should be done with properties, so that _engine is only obtained when requested and still None. Note also that all gen.lib obects objects should perhaps use __slots__ to reduce memory footprint.
When not yet initialized attributes are needed, the engine is requested for the data. For example the marker attribute of a person, which is a MarkerType() object. Eg, the code fragment
= References =
# - [httphttps://oldsourceforge.nabble.comnet/p/gramps/mailman/message/24262998/(Gramps-devel) LazyEvaluation in Gramps] From: Doug B. -Evaluation2009-in12-Gramps28 06:37:38 -ts26940237.html mailing list discussion]# - {{bug|3476}}: [http://www.gramps-project.org/bugs/view.php?id=3476 Lazy experiment (patch)]An experiment in lazy evaluation in gramps# - [httphttps://blog.gramps-project.org/blog/?p=211 Alternative Interfaces] January 23rd, 2010 by Doug Blank - Gramps Blog post discussing ideas]
[[Category:GEPS|F]]