"Lester Caine" wrote in message news:5747f02a.2010...@lsces.co.uk...
On 26/05/16 22:36, Rowan Collins wrote:
So every time I update the current tree because the client has selected
a different initial root I have to destroy perhaps 30 person objects and
rebuild the whole lot again from scratch?
In a word, yes: if you have a different set of data, use a different set
of objects to hold it.
Objects are not memory slots to be re-filled, they represent a specific
instance of a thing.
I disagree completely. In a database system there is no rule that says an
object can only hold data from a single row otherwise Martin Fowler, the
author of PoEE, would not have patterns that hold data from several rows.
When I instantiate one of my table classes it is a valid but empty object.
There are two actions I can perform - inject data from the client via the
$_POST array, or tell it to retrieve data from the database. This may
involve just a single row, or multiple rows. When reading from the database
it may even result in zero rows.
You are trying to change the language to suit the way that you work without
considering the fact that your way is not the only way and this change may
not suit the way that others work. As far as I can see this proposal not
only does not solve a genuine problem, it adds levels of complexity that
will do nothing but increase the WTF! factor for untold numbers of
programmers who have been happily using the language for years.
--
Tony Marston
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php