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

Multiple Inheritance (Top 10 IDL Requests)

One topic that didn't let me off the hook:

Michael Plonski wrote:
> [...]
> 4) Multiple inheritance from objects with a common data field name.   I
> like that you can explicitly reference an inherited objects methods, why
> can't they make it so that you can also reference an inherited objects
> data structure.    IDL could follow the same multiple inheritance rules
> that it applies to methods.  I actually don't even care about being able
> to specifically access all the fields in the inherited objects as unique
> fields. My primary beef is that the inheritance fails if you have
> conflicting field names in two different objects. [...]

A potential solution to this problem would be aliasing. Fortran90 has a
very nice
syntax for modules which would accomodate multiple object inheritance
easily. How 
about something like:

      object = { class_name,  $
                 INHERITS base_class ONLY=(index, name=>basename), &
                 INHERITS other_class ONLY=(name)  }

Here, "index" would be taken from base_class as is, but base_class'
"name" tag would be 
referenced as "basename" in the new object, and other_class would also
provide a "name" field
which would be seen as "name". The ONLY specifier would also add some
"privacy" to the objects.
It could perhaps be supplemented with an ALIAS "keyword" which would not
exclude other fields but only
do the aliasing [only one of the two could be used for one inheritance].

... and I also second this one:
> 5) public, private operations for object inheritance


[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[