Stanislav Malyshev wrote:

>> I realize that instance calls are a completely different ball game than
>> static  calls but LSB was supposed to give us the same flexibility.
>
> Actually, I don't think it was. If you want objects, why not use the
> real thing? LSB was created to solve just one particular problem -
> inability to distinguish A::method() from B::method() if B extends A.

Being one of the original people requesting this I would have to say
that you aren't completely accurate in that statement. That may have
been the goals of the most recent patch's collaborators but it certainly
wasn't mine. The reason I originally wanted it was because the way
statics were originally implemented was too rigid to do things that I
wanted to with them. LSB was a way to provide a flexible inheritance
model for static classes. This would allow for the framework creator's
dream of not having to instantiate objects for the sole purpose of
instantiating new objects:

$model = new Author();
$more_models = $model->findByName('Mike');

Instead you could place your 'factory' code into a base class as a
static and extend it appropriately. This goal was met, but with yet
another severe limitation in that you lose the ability to reimplement
after you extend. In my opinion this is foundational to object oriented
design and I know that alot of people agree with me. So in that vain
what's wrong with going the full length on a new feature that isn't set
in stone?

>
>> called class on. It would allow more complex forms of inheritanc
> "more complex" is not always better.

Rest assured that this is not the bad kind of 'more complex' I believe
that with a large number of OO programmers this is going to be more
natural. Bear in mind that this patch is in a large part geared to
please those people that though self:: should have referred to the
calling class to begin with. I can all but guarantee that you will be
hearing the same arguments about 'parent::' within a fairly short amount
of time after 5.3 goes out. Maybe then we will talk about 'Later Static
Binding' :P.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to