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

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)

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to