<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi, </font></p>
<p><font size="4">I am looking for idea and design idea regarding
persistence of objects.</font></p>
<p><font size="4">In the DyboApp, the user data are saved in a tree
of objects</font></p>
<ul>
<li><font size="4">userData (root)</font></li>
<ul>
<li><font size="4">schools</font></li>
<ul>
<li><font size="4">classGroups</font></li>
<ul>
<li><font size="4">courses</font></li>
<ul>
<li><font size="4">topics</font></li>
<ul>
<li><font size="4">documents</font></li>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
<p><font size="4">The most complex data are the documents. A
document represents a metaphor of pages with handwritten notes,
and an arbitrary number of tools, dropped pictures from the host
filer, etc. Moreover a page may have a model as simple as a
background color, or a particular design as horizontal lines,
grid, graph paper or a pdf.</font></p>
<p><font size="4">Because of this complexity, I serialize the
documents in individual compressed files, it is fast at saving
and loading. Because serializing the userData root save all the
data by default, each Document instances in the documents
collection (at the bottom of the tree above), are in fact
DiskProxy containing the path to the independently serialized
Document instances.</font></p>
<p><font size="4">This works well when saving the whole userData or
an individual Document. However, at start-up, accessing the
userData load everything, which is fine expect for the documents
collection and its Documents instances (through the Disk proxy).
As the documents collection, it may become slow when I will have
several hundreds of documents.</font></p>
<p><font size="4">I have some ideas how to improve this, but I am
interested to read other opinions and experience on the matter.</font></p>
<p><font size="4">Thanks</font></p>
<p><font size="4"><br>
</font></p>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://mamot.fr/@drgeo">http://mamot.fr/@drgeo</a></pre>
</body>
</html>