[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Containers: The REALLY difficult stuff...



Hi there!

Don't get me wrong, the discussion has been interesting up to now, but all
those topics have been "solved in my mind" for some time now. What is
really scaring the **** out of me design-wise is another problem:

   How can we separate abstract and concrete structure in a general way?

Let me give one example of what I mean: Consider a "Set" abstraction. It
can be defined (informally) as having elementary operations "Insert",
"Remove", "In" and "Empty", as well as "higher-order" operations "Union",
"Difference", and so on.

Now these can of course be implemented in various ways, eg. by using a
"java.util.Vector" like class, by a linked list, by various trees, etc. The
problem is how we combine "abstract" behaviour with a "concrete"
implementation. I would like to be able to do the following:

   VAR s: Set; l: List;
   ...
   BEGIN
     NEW (s); NEW (l);
     s.UseImplementation (l);
     ...

So how do we do that? I have that strange feeling that this is next to
unsolvable with the Oberon-2 context in which we are operating...

By(T)e...        /  Department of Information and Computer Science  \
        Peter... \ University of California - Irvine, CA 92697-3425 /