This sound all good and well however this does not change the
fact that you CANNOT use "old hook methods’’ if the signature
(arity) of the primary method changed - in this case you have
to trash the current hook method stack in one way or the other.
If the arity goes up, you can avoid problems provided the first arguments
remain the same and your hook doesn’t care about them by using a *arg as
in my example…
I feel you gave only very weak argument why in this particular
circumstance the removal shouldn’t happen automatically.
OK, I didn’t realize your argument was in case of arity changes, just like
you didn’t realize my argument was for the general case. Cool! But
seriously, if that particular circumstance is rare enough, why care?
(Gee, they already brainwashed me So you still need to show that a
change in arity happens often enough compared to say change of
implementation. I think that highly depends on how you write your code,
whether you work top-down - first get the interfaces right, then implement
- or bottom-up - start implementing small parts and build on that to make
larger parts. Or whether you combine both.
Also, if you’d change a method and need extra arguments for extra
functionality, then if your hook can’t handle those extra arguments
generically, that’s pretty tight coupling, isn’t it?
Peter