Re: References

From: Date: Thu, 13 Jul 2000 16:15:24 +0000
Subject: Re: References
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24461@lists.php.net to get a copy of this message
Sascha Schumann wrote: > On Thu, 13 Jul 2000, Kristian [iso-8859-1] Köhntopp wrote: > > Fundamental change in the serialization format. > > Serialize values distinct from names, just as > > Unix stores files distinct from their names. That > > way a single variable can have multiple names, > > just as a single file can have multiple names. > > If your code depends on preserving variable references across multiple > HTTP requests, your design is flawed IMO. Not at all. Consider the construction of a SQL query against a treelike structure of keywords (a library catalog). There is a pool of keywords, unstructured. You may think of them like files with inodes on a Unix disk. There is a structure for these keywords, organizing them in one or multiple tree structures, referencing each keyword zero, once (common case) or multiple times from different locations in the tree. Think of user interface which lets the user choose keywords she is interested in. Choosing a keyword will also select all keywords below that position in the currently active tree. From the users selection, a SQL query or other queries may be constructed. Now, if you serialize the array of user selected keywords, this array will contain pointers to the tree structure, which will in turn contain pointers to the keywords from the keyword pool. Serializing the selected keywords array will ultimately serialize the complete tree structure and the keyword pool with it, as they are linked and following the references will build the serialization closure of the structure that is to be serialized. This is called deep serializing. (The example has been taken from the thesis of my wife, Marit Köhntopp. Look at http://www.koehntopp.de/marit/publikationen/diplomarbeit/index.html for the user interface of that example, and if you want to, download her thesis (zoo archive of a postscript file) and have a look at Chapter 4. All this is available in German language only, I am sorry.). Kristian -- Kristian Köhntopp, NetUSE AG Siemenswall, D-24107 Kiel Tel: +49 431 386 436 00, Fax: +49 431 386 435 99 Using PHP3? See our web development library at http://phplib.netuse.de/

« previous php.dev (#24461) next »