On Tue, 19 Feb 2008 13:23:57 +0100, "Stefan Marr" <[EMAIL PROTECTED]> wrote:

> Traits can defined abstract methods to define a required method. This
> abstract methods can be implemented in the class or in an other trait.
> 
> There are also notions about stateful traits out there. For instance
> Scala does implement them, but state is an additional level of
> complexity and I have tried to avoid it in this implementation, since
> I have had expected much more complains about the aliasing and exclude
> operations and its pretended complexity.
> In my opinion stateful traits are the next logical step, but with the
> cost for some additional complexity, since you need handle conflicting
> properties. (The stateful traits approach is to make it private to a
> traits composition, but this might not be obvious to every user.)
> 
> Kind Regards
> Stefan

(Sorry for the double email; I meant to send this to the list.)

So if the Trait is not stateful, what is the advantage over delegation?  That
was cited in an earlier email as a shortcoming of delegation, but if the Traits
implementation doesn't address it either except through a getter/setter, then
it's still functionally equivalent to delegation.

--Larry Garfield

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

Reply via email to