Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called

From: Date: Thu, 22 Jun 2000 22:20:53 +0000
Subject: Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22011@lists.php.net to get a copy of this message
At 03:11 PM 6/22/00 -0700, Rasmus Lerdorf wrote:
If you want to implement on-demand class loading, you are welcome to. That actually might be interesting feature. But certainly it shouldn't shove it into deserializer, though deserializer could use it. On-demand loading could indeed be useful, though I imagine there could be some problems with it (if there are more than one class in the file). But certainly this has absolutely nothing common with shoving class code into object definition. And I repeat. My main point here was to maintain a connection between the class definition and the object data. That would make it possible to autoload them or provide user controlled loading without needing to keep track of which file might define which class.
I personally understood your point and it goes against everything I have learnt over the years especially any OOP concepts I have encountered. Sending the class definition with the object data is wrong. Not only because it is not done but because it is not done for a good reason. Think about putting these monsters in databases or other storage areas. On the other hand the idea of saving a path to the class definition is even worse in my opinion. What if the path isn't the same on all servers accessing the central database? God, let's just for once keep it stupid simple and give the coder a bit of credit. He can figure it out and I can assure you that most coders that come from an OOP background won't expect the class to be sitting in their database nor it being loaded magically from someplace on their local disk. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#22011) next »