Subject: predicate methods and extensibility are non-orthogonal?
From: Mayur Naik (mhn@hotbot.com)
Date: Thu Apr 27 2000 - 07:35:53 PDT
Hello
Consider the following code:
abstract object X;
template object A isa X;
method foo(n) when n@A { ... } -- m1
Suppose I wish to extend the above code at a later stage:
template object B isa X;
If I want to invoke method m1 when B is the run-time class of the
receiver of the 'foo' message, I have to modify the existing code
and recompile it:
method foo(n) when n@A or n@B { ... } -- m1
However, modifying existing code is non-OO. One way to solve the
above problem is to make B a subclass of A. But this is a kludge.
I feel a graphical programming environment (discussed in the paper
"OO Multi-Methods in Cecil") can solve this problem by allowing
the programmer to add new OR gaurds to existing methods. In this
case, recompilation of existing code (for instance, the body of
method m1) is not required.
I think this non-orthogonality between predicate dispatch and
extensibility arises only in the case of the OR operator and not
in the case of the AND and NOT operators.
Could you please comment? Thanks for your time.
-- Mayur
HotBot - Search smarter.
http://www.hotbot.com
This archive was generated by hypermail 2b25 : Tue Oct 03 2000 - 15:21:32 PDT