[Zope] Will the inheritance relationship will be preserved af ter export/import?

NABETH Thierry Thierry.NABETH@insead.fr
Thu, 10 May 2001 10:07:25 +0200


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0D928.3FDC1100
Content-Type: text/plain;
	charset="iso-8859-1"

Hello Iap,

>> The interitance relationship seems broken after export/import
between different ZODB.

Following is the message I have posted about this bug in January.
I have mentioned already this bug several time, but until now I seemed
to be the only one that care about this bug. (which makes me ask question
about how much or how little the Zope community is using object orientation
and inheritance with the Dtml language).

I have personally stopped all design on the Zope platform (which I find
some concept very interesting), and am concentrating my effort on
Java/servlets
because of this bug.

I hope you find some way to solve your problems.

Bye,

Thierry

-----Original Message-----
From: Thierry Nabeth [mailto:Thierry.Nabeth@insead.fr]
Sent: Saturday, January 06, 2001 10:46 PM
To: zope@zope.org
Cc: Thierry Nabeth
Subject: Serious BUG in Export. ==> pb of lost inheritance if export /
reimport.


Hello,

I would like to mention a very serious bug (for me), that prevent to use
inheritance between two classes defined in two different package, if
you have to export and reimport those packages.

In a previous mail I mentionned a problem of Inheritance lost between
packages.

I spent a lot of time investigating the problem, and in particular looking
in the
export file (xml version).

First here is the test:

Phase 1: create the products and the classes.

Create a product PA
Create a class A in the product PA.
Create a method "test" in class A.  (this method display "before").

Create a product PB
Create a class B in the product PB which inherits from A.

Create an instance a of A.
Create an instance b of B.

Phase 2: test the inheritance.  ==> everything works fine

Executing the method "test" on those two instances return.
a.test  ==> "before"
b.test  ==> "before"
The result is correct.

Phase 3: export / reimport product PB, and modify methode "test".

Export the product PB. (PB.zexp is generated)
Delete the product PB and restart zope.
Import the product PB (PB.zexp) and restart zope.

Modify the method "test" in class A..  (this method display "after").

Phase 4: test the inheritance.  ==> B does not work correctly.

Executing the method "test" on those two instances return.
a.test  ==> "after"
b.test  ==> "before"      ####### this is incorect. !!!!!!


I spent a lot of time investing this problem, in particular looking
in the xml export file.
The problem is that when you export PB, the exported file also
contain the definition of class A.
When you re-import PB, B inherits from a class A that is different
from the class A that is in the product PA.
You have a kind of Zombie class A.
(note: reimporting class A doesn't solve the problem).

If someone has some idea how to fix this bug which almost forbid
the use of inheritance between products in zope (unless you have a
master server that never import anything) ?!

Thierry Nabeth
Research Fellow,
INSEAD CALT (The Centre for Advanced Learning Technologies)
http://www.insead.edu/CALT/
Thierry.Nabeth@insead.fr



------_=_NextPart_001_01C0D928.3FDC1100
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Zope] Will the inheritance relationship will be preserved after export/import?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hello Iap,</FONT>
</P>

<P><FONT SIZE=2>&gt;&gt; The interitance relationship seems broken after export/import</FONT>
<BR><FONT SIZE=2>between different ZODB.</FONT>
</P>

<P><FONT SIZE=2>Following is the message I have posted about this bug in January.</FONT>
<BR><FONT SIZE=2>I have mentioned already this bug several time, but until now I seemed</FONT>
<BR><FONT SIZE=2>to be the only one that care about this bug. (which makes me ask question</FONT>
<BR><FONT SIZE=2>about how much or how little the Zope community is using object orientation</FONT>
<BR><FONT SIZE=2>and inheritance with the Dtml language).</FONT>
</P>

<P><FONT SIZE=2>I have personally stopped all design on the Zope platform (which I find</FONT>
<BR><FONT SIZE=2>some concept very interesting), and am concentrating my effort on Java/servlets</FONT>
<BR><FONT SIZE=2>because of this bug.</FONT>
</P>

<P><FONT SIZE=2>I hope you find some way to solve your problems.</FONT>
</P>

<P><FONT SIZE=2>Bye,</FONT>
</P>

<P><FONT SIZE=2>Thierry</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Thierry Nabeth [<A HREF="mailto:Thierry.Nabeth@insead.fr">mailto:Thierry.Nabeth@insead.fr</A>]</FONT>
<BR><FONT SIZE=2>Sent: Saturday, January 06, 2001 10:46 PM</FONT>
<BR><FONT SIZE=2>To: zope@zope.org</FONT>
<BR><FONT SIZE=2>Cc: Thierry Nabeth</FONT>
<BR><FONT SIZE=2>Subject: Serious BUG in Export. ==&gt; pb of lost inheritance if export /</FONT>
<BR><FONT SIZE=2>reimport.</FONT>
</P>
<BR>

<P><FONT SIZE=2>Hello,</FONT>
</P>

<P><FONT SIZE=2>I would like to mention a very serious bug (for me), that prevent to use</FONT>
<BR><FONT SIZE=2>inheritance between two classes defined in two different package, if</FONT>
<BR><FONT SIZE=2>you have to export and reimport those packages.</FONT>
</P>

<P><FONT SIZE=2>In a previous mail I mentionned a problem of Inheritance lost between</FONT>
<BR><FONT SIZE=2>packages.</FONT>
</P>

<P><FONT SIZE=2>I spent a lot of time investigating the problem, and in particular looking</FONT>
<BR><FONT SIZE=2>in the</FONT>
<BR><FONT SIZE=2>export file (xml version).</FONT>
</P>

<P><FONT SIZE=2>First here is the test:</FONT>
</P>

<P><FONT SIZE=2>Phase 1: create the products and the classes.</FONT>
</P>

<P><FONT SIZE=2>Create a product PA</FONT>
<BR><FONT SIZE=2>Create a class A in the product PA.</FONT>
<BR><FONT SIZE=2>Create a method &quot;test&quot; in class A.&nbsp; (this method display &quot;before&quot;).</FONT>
</P>

<P><FONT SIZE=2>Create a product PB</FONT>
<BR><FONT SIZE=2>Create a class B in the product PB which inherits from A.</FONT>
</P>

<P><FONT SIZE=2>Create an instance a of A.</FONT>
<BR><FONT SIZE=2>Create an instance b of B.</FONT>
</P>

<P><FONT SIZE=2>Phase 2: test the inheritance.&nbsp; ==&gt; everything works fine</FONT>
</P>

<P><FONT SIZE=2>Executing the method &quot;test&quot; on those two instances return.</FONT>
<BR><FONT SIZE=2>a.test&nbsp; ==&gt; &quot;before&quot;</FONT>
<BR><FONT SIZE=2>b.test&nbsp; ==&gt; &quot;before&quot;</FONT>
<BR><FONT SIZE=2>The result is correct.</FONT>
</P>

<P><FONT SIZE=2>Phase 3: export / reimport product PB, and modify methode &quot;test&quot;.</FONT>
</P>

<P><FONT SIZE=2>Export the product PB. (PB.zexp is generated)</FONT>
<BR><FONT SIZE=2>Delete the product PB and restart zope.</FONT>
<BR><FONT SIZE=2>Import the product PB (PB.zexp) and restart zope.</FONT>
</P>

<P><FONT SIZE=2>Modify the method &quot;test&quot; in class A..&nbsp; (this method display &quot;after&quot;).</FONT>
</P>

<P><FONT SIZE=2>Phase 4: test the inheritance.&nbsp; ==&gt; B does not work correctly.</FONT>
</P>

<P><FONT SIZE=2>Executing the method &quot;test&quot; on those two instances return.</FONT>
<BR><FONT SIZE=2>a.test&nbsp; ==&gt; &quot;after&quot;</FONT>
<BR><FONT SIZE=2>b.test&nbsp; ==&gt; &quot;before&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ####### this is incorect. !!!!!!</FONT>
</P>
<BR>

<P><FONT SIZE=2>I spent a lot of time investing this problem, in particular looking</FONT>
<BR><FONT SIZE=2>in the xml export file.</FONT>
<BR><FONT SIZE=2>The problem is that when you export PB, the exported file also</FONT>
<BR><FONT SIZE=2>contain the definition of class A.</FONT>
<BR><FONT SIZE=2>When you re-import PB, B inherits from a class A that is different</FONT>
<BR><FONT SIZE=2>from the class A that is in the product PA.</FONT>
<BR><FONT SIZE=2>You have a kind of Zombie class A.</FONT>
<BR><FONT SIZE=2>(note: reimporting class A doesn't solve the problem).</FONT>
</P>

<P><FONT SIZE=2>If someone has some idea how to fix this bug which almost forbid</FONT>
<BR><FONT SIZE=2>the use of inheritance between products in zope (unless you have a</FONT>
<BR><FONT SIZE=2>master server that never import anything) ?!</FONT>
</P>

<P><FONT SIZE=2>Thierry Nabeth</FONT>
<BR><FONT SIZE=2>Research Fellow,</FONT>
<BR><FONT SIZE=2>INSEAD CALT (The Centre for Advanced Learning Technologies)</FONT>
<BR><FONT SIZE=2><A HREF="http://www.insead.edu/CALT/" TARGET="_blank">http://www.insead.edu/CALT/</A></FONT>
<BR><FONT SIZE=2>Thierry.Nabeth@insead.fr</FONT>
</P>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C0D928.3FDC1100--