> I've been mucking about a bit more with this whole interface thing.
>
> So if we make method signatures only enforced on subclasses if the parent
> class or method has the interface property...
>
> ....except private methods, obviously.
>
> And if we make pre/post conditions and class invariants always enforced...
>
> ....shouldn't we have private invariants and conditions?

Semi-tangential to the point of your message...

With pre/post conditions, a subclass is allowed to weaken the
preconditions or strengthen the postconditions. The postcondition is not
really a problem since one can always add additional checks. However, if
the parent's preconditions apply to the child invariably, it would be
rather difficult to make your subclass accept a wider variety of input.

I'm not proposing a solution, but rather just a problem to keep in mind.

Mike Lambert

Reply via email to