Re: isa
Re: isa
- Subject: Re: isa
- From: Marcel Weiher <email@hidden>
- Date: Mon, 3 Jun 2002 16:04:55 +0200
On Monday, June 3, 2002, at 02:34 Uhr, Marco Scheurer wrote:
On Monday, June 3, 2002, at 01:41 pm, Ondra Cada wrote:
On Monday, June 3, 2002, at 05:48 , Aram Greenman wrote:
However, if A' inherits from A, saying an A' is an instance of A _is_
correct, insofar as it has all the instance variables of A and
therefore possesses everything that makes an A an A.
Right and wrong I would say.
Right, because in a reasonable design it is true that one should be
able to say that an instance of A' can be viewed as an instance of an
A. It is considered harmful for a subclass to violate expectations of
its superclass. This is of course the Liskov Substitution principle,
which is a good design heuristic, and the basis of design by contract.
Of course, this falls flat in this particular case because the "reason"
for wanting to twiddle the isa was an incompatible change in a method
(foo), so we're creating a workaround to a LSP-violation and in the
context of that workaround assuming that the LSP holds. Hmm...
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: isa (From: Marco Scheurer <email@hidden>) |