From: Gavin Sinclair Date: 2003-11-27T16:22:28+09:00 Subject: Re: Method wrapping On Thursday, November 27, 2003, 5:56:13 PM, T. wrote: > On Thursday 27 November 2003 07:07 am, Yukihiro Matsumoto wrote: >> |2. If the primary method is redefined, do the "secondary" methods >> |get cancelled? Or do they simply remain in place? >> >> They remain in place. > I don't think that's a desirable behavior. See previous post. > Also, the hooks (wraps) of a method are generally dependent on how that method > works. If you redefine a method without removing the hooks, your new method > will have to conform to the expectations of those hooks, or things will > break. If you are redefining your own method in development, you know what you're doing - you're probably just mucking around - and can sort out the wrappers yourself. If you are redefining someone else's method in production, on your own head be it. You should be keeping to the same interface of the original, or else other code is likely to break. Wrappers don't depend on the implementation of a method, as you assert. They depend on the interface. The wrappers should have no real side-effect anyway, I suspect, except for logging, asserting, ... It is certainly a curly area, though. Gavin