From: Jean-Pierre D. <jea...@tr...> - 2003-10-13 17:52:40
|
Yes Jim, In the other scheme of inheritance, the datatype grows outwards e.g. the = child datatype is constructed as embedded clusters: child typedef: {child added data,{parent data}} and is linked directly to immediate parent typedef In the proposed scheme, the datatype grows inwards e.g. the inner variant= is replaced with the cluster {{child added data},variant} child typedef: {{parent added data},{{child1 added data},{{child added da= ta},variant}}} then it is not linked directly to immediate parent typedef but to all {pa= rent added data} typedefs. We have to create two data typedefs for the class, {class added data} and inheritance data typedef. I also thought of a simplified, non-embedding approach, provided that we = limit the number of inheritance levels to say five levels: generic object datatype: cluster of 5 variants {variant, variant, variant= , variant, variant} 1st generation object: {{parent data}, variant, variant, variant, variant= } 2nd generation object: {{parent data}, {child data}, variant, variant, va= riant} and so on. Thise scheme also preserves the class casting behavior but is limited to = a fix number of inheritance levels. Objects Refnums could also be flattened instead of embedded. Jean-Pierre ----- Message d'origine -----=20 De : "Jim Kring" <ji...@ji...> =C0 : <ope...@li...> Envoy=E9 : 13 octobre, 2003 12:27 Objet : RE: [opengoop] Virtual Methods (Abstraction) Jean-Pierre, The problem is that a child is going to replace the variant with its own data cluster. If this variant is contained within the parent's data cluster, then the child must either edit or copy the parent's cluster. B= ut, the child is not allowed to edit the parent's cluster (we want the possibility of several children), so the only option is to make a copy of the parent's cluster. This means that if the parent changes, we have to also replicate the changes in the child's cluster. We don't want to do this, we want to link to the parent's data cluster. So, we should separa= te the parent's data from the Data Type Inheritance Cluster by means of putt= ing the parent's data into its own cluster. -Jim .net/lists/listinfo/opengtoolkit-developers |