From: Jim K. <ji...@ji...> - 2003-10-13 16:28:13
|
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. = But, 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 = separate the parent's data from the Data Type Inheritance Cluster by means of = putting the parent's data into its own cluster. -Jim > -----Original Message----- > From: ope...@li...=20 > [mailto:ope...@li...]=20 > On Behalf Of Jean-Pierre Drolet > Sent: Monday, October 13, 2003 8:04 AM > To: ope...@li... > Subject: Re: [opengoop] Virtual Methods (Abstraction) >=20 >=20 > Jim, >=20 > I did not mean clustered child data. I can't see why it=20 > doesn't work without cluster. What's that link/duplicate thing? >=20 > Jean-Pierre >=20 > ----- Message d'origine -----=20 > De : "Jim Kring" <ji...@ji...> > =C0 : <ope...@li...> > Envoy=E9 : 13 octobre, 2003 02:58 > Objet : RE: [opengoop] Virtual Methods (Abstraction) >=20 >=20 > Jean-Pierre, >=20 > The example that I posted to the "Data Type Inheritance=20 > Cluster" page won't work. In order to work the class data=20 > should be in its own cluster. I believe that the structure=20 > needs to look like the following: >=20 > object: variant > base: {{base data}, variant} > child: {{base data}, {{child data}, variant}}. > and so on >=20 > Instead of: >=20 > > object: variant > > base: {base data, variant} > > child: {base data, {child data, variant}}. > > and so on >=20 > I'm sure you meant that "base data" and "child data" are in=20 > fact clusters, but I didn't interpret it that way initially. =20 > Having class data in a cluster separate from the variant is=20 > necessary for a descendant to link to an ancestor's data=20 > store (rather than duplicating it). >=20 > I have posted a new "Example - Data Type Inheritance Cluster=20 > Coercion" at:=20 > <http://www.openg.org/tiki/tiki-index.php?page=3DData+Type+Inher itance+Cluster > This new example uses a class hierarchy from an OOP example (sent to me privately by Niels Harre), which graphs geometric objects to a picture control. -Jim ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. = SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED = US provide better services: Click here: = http://sourceforge.net/supporters.php _______________________________________________ OpenGToolkit-Developers mailing list Ope...@li... https://lists.sourceforge.net/lists/listinfo/opengtoolkit-developers |