Hi Francois,

On Sat, Feb 14, 2015 at 12:53 PM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

> On Sat, Feb 14, 2015 at 12:03 PM, François Laupretre <franc...@php.net>
> wrote:
>
>> > For method calls, overridden method should not evaluate parents
>> contract on entry.
>> > It should be evaluated when parent method is called.
>>
>> I already told you : the logic you are using for pre-conditions is NOT
>> compatible with Eiffel and D logic, although this is what you're supposed
>> to mimic. It is actually the opposite. Is it a wanted behavior ? because
>> you should be aware that it does not respect the LS principle.
>
>
> Did you mean "Least Concern Principle" here?


I'm lost here. Eiffel does not even allow method overriding. Therefore,
child class's method contract
will never evaluated unless it is explicitly called. Semantics is basically
the same as what I wrote.
(Eiffel requires to drop parent method by "redefine" or rename parent
method by "rename" when
the same method name is needed)

I agree that Eiffel's approach is stricter with respect to least concern
principle.
It's just not suitable for PHP, is it?

Similar argument can be done for D's invariant. D dropped invariant from
class in favor of
immutables. Immutable is better for least concern, but we don't have
immutables now.
Even if we have it, people would like to manage object state. We may have
both.

Anyway, could you explain what kind of issues we may have?

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to