Re: [PHP4BETA] Re: SESS: objects containing objects *final statement*(?) please read!
| From: | Kristian Köhntopp | Date: | Fri, 25 Feb 2000 16:06:07 +0000 |
| Subject: | Re: [PHP4BETA] Re: SESS: objects containing objects *final statement*(?) please read! | ||
| References: | 1 2 3 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10961@lists.php.net to get a copy of this message | ||
"Stig S. Bakken" wrote:
> Now, when it comes to waking up unserialized objects again, calling the
> constructor is definitely not what we want.
In Nextstep and Objective-C things were like this (for a reason):
The initializer (the initializing half of a constructor)
was always called "init" (and not like the class). That way,
you could have a derived class which had any class as a parent
class without coding the parent classes name multiple times.
This is unlike PHP and C++, where
class B extends A {
function B() {
A::A(); // call parent constructor
}
}
the parent class name is included multiple times, leading to
a classic update anomaly.
Then there were optional "freeze" and "wakeup" member
functions which, if present, were called before serialization
and after unserialization. These functions had the opportunity
to make the object ready for serialization or reinitialize it
after serialization. They also were able to return "false" to
exempt them from serialization as a whole.
Kristian
--
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.netuse.de/ (We have moved! Update your
bookmarks!)