Re: CLOS question
- From: Scott Burson <FSet.SLB@xxxxxxxxx>
- Date: Sun, 29 Jul 2007 22:39:40 -0000
On Jul 29, 3:19 pm, Rainer Joswig <jos...@xxxxxxx> wrote:
In article <1185747319.410983.157...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Scott Burson <FSet....@xxxxxxxxx> wrote:
If D is a subclass of C, then although D may override a primary method
of C, D's method should maintain all the invariants that C's method
does.
'should'. That's a design decision.
There is nothing in CLOS that enforces or requires that.
Indeed. I was answering not the question he was asking, but the
question I thought he _should_ be asking. Wasn't that obvious?
(Actually, I spoke of a possible error in domain _analysis_ -- a stage
that logically even precedes design.)
That said -- the principle that subclasses should only strengthen
invariants, not weaken them, is fundamental to object-oriented
programming. I can't recall ever seeing a case where the principle
was violated that didn't cause problems. So it's a very very very
strong "should".
-- Scott
.
- References:
- CLOS question
- From: Rob St. Amant
- Re: CLOS question
- From: Scott Burson
- Re: CLOS question
- From: Rainer Joswig
- Re: CLOS question
- From: Scott Burson
- Re: CLOS question
- From: Rainer Joswig
- CLOS question
- Prev by Date: Re: CLOS question
- Next by Date: Re: CLOS question
- Previous by thread: Re: CLOS question
- Next by thread: Re: CLOS question
- Index(es):