Re: CLOS question



On Jul 29, 3:09 pm, Rainer Joswig <jos...@xxxxxxxxxxxxxx> wrote:
In article <1185746464.124847.288...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Scott Burson <FSet....@xxxxxxxxx> wrote:

This suggests to me that you have analyzed your domain incorrectly.
It would seem that D is not really a subclass of C if you don't want
it to inherit the full behavior of M.

Why that? Each more specific primary method blocks the
less specific primary method. Thus you are not inheriting
the whole functionality. Sure, you can call the next method,
but by default this is not done. Overwriting less specific
functionality is a capability provided for primary
methods. Just not for :before and :after methods. But those
were design decisions for the standard method combination.

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. Demon methods are a handy way of maintaining invariants. It
doesn't sound right to me that C would have some invariant that it is
maintaining with a demon method, and yet that invariant doesn't apply
to one of its subclasses.

-- Scott

.



Relevant Pages

  • Re: CLOS question
    ... it to inherit the full behavior of M. ... Each more specific primary method blocks the ... If D is a subclass of C, then although D may override a primary method ... doesn't sound right to me that C would have some invariant that it is ...
    (comp.lang.lisp)
  • Re: SoA Vs OO
    ... > several types T1...Tn which let says might inherit from one another ... Say the Window class contains a GdiHandle member. ... it's doing very, very crufty internal stuff, so the subclass can't even ... If refactoring tools were a solution, ...
    (comp.object)
  • Re: SoA Vs OO
    ... > several types T1...Tn which let says might inherit from one another ... Say the Window class contains a GdiHandle member. ... it's doing very, very crufty internal stuff, so the subclass can't even ... If refactoring tools were a solution, ...
    (comp.programming)
  • Re: Subclassing, Inheritance, RE subclass "constructor" and inherited members
    ... // a subclass AND what is wrong with the loop ONLY ... There are only objects, which inherit ... from other (prototype) objects. ... it is not a bad idea to indent script code a bit ...
    (comp.lang.javascript)
  • Re: Base class - Derived class interaction question
    ... throwing me off is that the plus method has to return a reference of ... Since constructors don't inherit it follows that if you want do this ... at all you /cannot/ use an explicit constructor in the shared code. ... creation of the new object into something that the subclass can override. ...
    (comp.lang.java.programmer)