<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 22 Jan 2007, at 10:54 AM, Bčr Kessels wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I don't like the idea of storing a 'thing' in one table alone. Its not good<SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">for performance and horrible when you want to normalise your data.<SPAN class="Apple-converted-space"> </SPAN></FONT></P> </BLOCKQUOTE></DIV><BR><DIV>Anyway, this is part of what the data api stuff i presented at DrupalCon tackled, </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>you can see some example code in my sandbox (along with my slides).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You would define one function (model_X), which would define the fields and constraints of </DIV><DIV>the object. You can define multiple views (forms or displays) of the object by defining display_X or form_X functions.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The fapi callbacks now become CRUD functions for the model. IE: create_X, load_X, update_X, delete_X.</DIV><DIV>Just by defining the model, and at least one of the CRUD functions, fapi can automatically create a form for you.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Instead of having node_load, etc. We would have one function drupal_load('X', $id, $id2, $id3); (or drupal_load('X', array(/* fields */)) );</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Inside the drupal_load, drupal_delete etc functions, we would have a mechanism that manages the object table.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>IE: when inserting a node, it adds an entry into objects for</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>type: node</DIV><DIV>oid : 12</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>When loading a node, it also loads up the info from the object table.</DIV><DIV>It'll also be able to load up any object using drupal_load('object', $oid);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--</DIV><DIV>  Adrian</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>