Hi,
On 25 Nov 2008, at 13:39, Marcus Boerger wrote:
Your points are all well observed. And yes I limit what my approach
can
do in order to Keep It Simple Safe (KISS). While still being able to
manually interfere with/overload the autogenerated code when
necessary.
At the same time forcing to delegate to a defined Interface and not
allowing to rename on the fly prevents abusing the functionality and
helps maintainability. On the other hand it forces you to think before
coding as this approach comes with a lack of functionality.
Ok, but now we start to talk about two clearly different things.
On the one hand something like traits, mixins, or what ever, and
restricted syntax sugar for delegation on the other hand.
While designing grafts, the idea was to provide a similar power like
traits do, but introducing state and encapsulation. From my point of
view, there is no other way to achieve this. At least I have not found
it.
All things in between, like "unbreakable traits" add more complexity
then they solve problems.
So actually, we are somewhere near the point which I intended to reach
with my proposal.
The questions we should answer now are:
- Does PHP need horizontal reuse?
- Do we go for an explicit solution? (traits)
- Do we go for some sort of syntax sugar for delegation? (grafts,
delegate keyword)
- Or do we go the implicit way? (mixins, phyton multiple-inheritance)
Nevertheless, I would love to get some more comments on grafts before
answering this questions, because this could give additional insights
in the real problems with this approach and some ideas for improvements.
Best Regards
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php