<html>
<body>
<font size=3>Inheritance is always rather tricky against a relational
database, because the concept really isn't there, so you have to map it
into some compromise, trading off space, query time, and flexibility.
Glorp supports two different strategies for this, which we call
horizontal and filtered. Filtered inheritance means all instances are
stored in one bit table, and there's a field which indicates which type
this row represents. This is efficient to query, but wastes spaces.
Horizontal is where each subclass is represented by an entirely separate
table. This is more likely if you're trying to impose an inheritance
hierarchy on an existing database, and minimizes storage, but makes
querying more complex. Some kinds of queries can be inefficient. You'd
want to look at the TypeResolver class and its subclasses. In the Glorp
tests, GlorpInheritanceDescriptorSystem has some examples.<br><br>
By comparison, storing integers and dictionaries is pretty easy :-) If
you want both key and value to be simple types, then you need a table
somewhere to store them. If the value is an object, you can either have
the key be part of the value's table, or in a link table.
GlorpDictionaryMappingTest and GlorpEncyclopediaDescriptorSystem have
examples.<br><br>
Neither of those things is likely to work automatically with the
GlorpActiveRecord code, you'll likely have to write out the mappings. But
part of the point of the way GlorpActiveRecord is done is that you can
let the parts that are easy get built automatically and only have to
specify the tricky parts.<br><br>
At 06:01 AM 12/12/2007, Oleg Richards wrote:<br><br>
<blockquote type=cite class=cite cite="">Boris!<br><br>
What about my other questions (inheritance, integer storage)? Can
you<br>
recommend me something?<br><br>
Oleg<br><br>
<br><br>
Boris Popov-2 wrote:<br>
&gt; <br>
&gt; No, we have our own db mapping framework at the core of our
application.<br>
&gt; With GLORP there is quite a bit of flexibility as far as your
mapping is<br>
&gt; concerned, but it has relational db as the store, so you would need
to be<br>
&gt; familiar with it somewhat. Other options are gemstone, boss files or
xml<br>
&gt; :)<br>
&gt; <br>
&gt; Cheers!<br>
&gt; <br>
&gt; -Boris<br>
&gt; (Sent from a BlackBerry)<br>
&gt; <br>
&gt; ----- Original Message -----<br>
&gt; From: seaside-bounces@lists.squeakfoundation.org<br>
&gt; &lt;seaside-bounces@lists.squeakfoundation.org&gt;<br>
&gt; To: seaside@lists.squeakfoundation.org<br>
&gt; &lt;seaside@lists.squeakfoundation.org&gt;<br>
&gt; Sent: Tue Dec 11 22:14:01 2007<br>
&gt; Subject: Re: [Seaside] Persistence in VW<br>
&gt; <br>
&gt; <br>
&gt; Hello Boris and Michael!<br>
&gt; <br>
&gt; Thanks for your advises. I want to ask for a few more
questions:<br>
&gt; <br>
&gt; I have a lot of inheritance: Template - Flow template; different
kind of<br>
&gt; rows; reconciliated report. How will they work?<br>
&gt; <br>
&gt; Currently i am storing all data in class side dictionaries and a lot
of<br>
&gt; binding was done with dictionaries too. Can i keep them or i should
remake<br>
&gt; bindings for the relation needs through ids. <br>
&gt; <br>
&gt; Should i keep my dictionaries or i should make afinders un database
in<br>
&gt; place<br>
&gt; of them?<br>
&gt; <br>
&gt; And main problem: I have a report object which stores a values in
hash<br>
&gt; where<br>
&gt; the row code (3 letter) is a key and money amount is a value. How
can i<br>
&gt; store this in db using glorp? I dont have special class for it, so
how to<br>
&gt; do<br>
&gt; mapping? Can u show me example?<br>
&gt; <br>
&gt; Boris are you using ActiveRecord and GLORP too? <br>
&gt; <br>
&gt; Oleg<br>
&gt; -- <br>
&gt; View this message in context:<br>
&gt;
<a href="http://www.nabble.com/Persistence-in-VW-tp14283675p14289650.html" eudora="autourl">
http://www.nabble.com/Persistence-in-VW-tp14283675p14289650.html</a><br>
&gt; Sent from the Squeak - Seaside mailing list archive at
Nabble.com.<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; seaside@lists.squeakfoundation.org<br>
&gt;
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; seaside@lists.squeakfoundation.org<br>
&gt;
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt; <br>
&gt; <br><br>
-- <br>
View this message in context:
<a href="http://www.nabble.com/Persistence-in-VW-tp14283675p14292647.html" eudora="autourl">
http://www.nabble.com/Persistence-in-VW-tp14283675p14292647.html</a><br>
Sent from the Squeak - Seaside mailing list archive at
Nabble.com.<br><br>
_______________________________________________<br>
seaside mailing list<br>
seaside@lists.squeakfoundation.org<br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</font></blockquote></body>
<br>
<div>--</div>
<div>Alan Knight [|], Cincom Smalltalk Development</div>
<div>knight@acm.org</div>
<div>aknight@cincom.com</div>
<div><a href="http://www.cincom.com/smalltalk" EUDORA=AUTOURL>
http://www.cincom.com/smalltalk</a></div>
</html>