Re: CLOS question
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Mon, 30 Jul 2007 22:15:37 -0400
In article <joswig-453135.00094030072007@xxxxxxxxxxxxxxxxxxxxxxxx>,
Rainer Joswig <joswig@xxxxxxxxxxxxxx> wrote:
In article <1185746464.124847.288820@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Scott Burson <FSet.SLB@xxxxxxxxx> wrote:
On Jul 29, 2:27 pm, stam...@xxxxxxxx (Rob St. Amant) wrote:
I have what seems like a familiar CLOS question, but a quick Google
search doesn't turn up an answer: I have a method, m, and an after
method for it. The after method is specialized on class c. I'd like
to define a class d that inherits c, and have instances of d behave
just like instances of c *except* for that single after method.
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.
IMHO, :BEFORE and :AFTER methods were created primarily to support the
mixin style of OO programming. If you don't want to inherit these
methods, you simply don't mix the parent class into your class.
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- Follow-Ups:
- Re: CLOS question
- From: Kent M Pitman
- Re: CLOS question
- References:
- CLOS question
- From: Rob St. Amant
- Re: CLOS question
- From: Scott Burson
- Re: CLOS question
- From: Rainer Joswig
- CLOS question
- Prev by Date: Re: Some expert comment please
- Next by Date: Re: Some expert comment please
- Previous by thread: Re: CLOS question
- Next by thread: Re: CLOS question
- Index(es):
Relevant Pages
|
|