RE: [PHP-DEV] How to build a real Trait thing without exclusion and renaming
| From: | Andi Gutmans | Date: | Thu, 28 Feb 2008 07:59:07 +0000 |
| Subject: | RE: [PHP-DEV] How to build a real Trait thing without exclusion and renaming | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35843@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Stanislav Malyshev [mailto:stas@zend.com]
> Sent: Wednesday, February 27, 2008 11:21 PM
> To: Andi Gutmans
> Cc: php@stefan-marr.de; internals Mailing List
> Subject: Re: [PHP-DEV] How to build a real Trait thing without
> exclusion and renaming
>
> > This is just an example of being able to alias a method from a
trait.
> > Assuming two traits would use the same name this would give you the
> > ability to include it under a different name.
> > The point is we can alias but we can not remove.
>
> That's what I am asking - why alias? You have perfectly good name for
> each one - A::whatever and B::whatever - which are unique. Why you
need
> any more aliases?
The idea of Traits (whether you agree with it or not) is about a more
flexible way of assembling classes and reusing pieces of functionality.
The paradigm is different from inheritance/interfaces so the
A::whatever/B::whatever is really not relevant in this context unless I
have completely misunderstood you but I don't think I have.
Andi