[Zope] RE[3]: [Zope] Product inheritance question. ==> Pb. moving clas s from a product to another + etc. s from a product to another + etc.

NABETH Thierry Thierry.NABETH@insead.fr
Wed, 30 Aug 2000 20:01:40 +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_01C012AB.919B806E
Content-Type: text/plain;
	charset="iso-8859-1"

Hello,

>> If it is a class method, it must be inherited by any derived
class.

This is what I had done.


However, I had the time finally to conduce the following tests.
 - create a Product P1 
      (Note: I used the word "package" instead of Product in my previous
postings)
 - create a Class A in P1
 - create a method z in the Class A
 - create a Product P2
 - create a Class AA that inherits A in product P2.
 - create an object 'o' instance of Class AA.
 - make the test of calling the method z on 'o'.

Results: everything works fine !!
So everything seems to work correctly with the new version.

However, when I try to do the same (create a method z and test) for Packages
that I had created in the previous version of Zope, it just does not work !!
(I have imported in the new version the class I had created in the previous
version).

I believe that this had to do with the trick I used to split and existing
Product
in several Products: Since I could not move a class directly from a package
to another,
I created 2 copies of the same packages. I deleted from the first package
the class I wanted
to move. From the second package, I deleted the classes I didn't want to
move.
The result was 2 packages with each the correct set of classes.
The problem is that this seems to have generated some kind of inconsistancy,
in particular related to the namespace: the second package do not have
access to
the namespace of the first package.

I know this was a relatively ugly way to proceed, but I found at that having
a zillion of classes in a same package was even more ugly, and I needed to
reduce
this complexity by introducing more modularity.

Of course, at the beginning I couldn't predict which Products and which
classes
 would exist and I decided to start with one package and split it later.
If you had nor noticed I used some kind of
incremental/prototypical/evolutionary/blablabla
methodology.

Unfortunatly, not being able -- to move classes from one product to another
-- makes
the use of this methodology problematic :-(.

Another similar problem is that you can not modify a posteriori the
inheritance tree.
(for instance when you decompose a class into 2 subclasses that inherit from
one another).


To conclude, I find Zope to be a very interesting systems (because it is
dynamic,
object-oriented, integrate seamlessly an OO database, etc.).
However, it would be an even better system if it provided more flexibility
to
reengineer an architecture. (very important when you use a prototypical
approach).

Or perhaps, there is something I have not understood ?

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


-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Monday, August 21, 2000 10:47 PM
To: thierry.nabeth@insead.fr
Subject: Re: RE[2]: [Zope] Product inheritance question (similar
question)


NABETH Thierry writes:
 > What I will have to do:
 > - create a Package (Zope product).
 > - create a class in this package, and a method (my_method)
This should be a method of the class,
not a method in the packages.

If it is a class method, it must be inherited by any derived
class.

Dieter


-----Original Message-----
From: NABETH Thierry 
Sent: Friday, August 18, 2000 9:29 AM
To: 'zope@zope.org'
Subject: RE: [Zope] Product inhetitance question (similar question)


And what happen if the Class A is in a package PA.
Clabb B is in a package PB.

How do you access the namespace of PA from PB ?

When I have tried, the inherited methods from A where not visible
from B, and I and to recreate a copie of the method.
(which is ugly !!!).

Any suggestion ?

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

------_=_NextPart_001_01C012AB.919B806E
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE[3]: [Zope] Product inheritance question.  =3D=3D&gt;  Pb. =
moving class from a product to another + etc.</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hello,</FONT>
</P>

<P><FONT SIZE=3D2>&gt;&gt; If it is a class method, it must be =
inherited by any derived</FONT>
<BR><FONT SIZE=3D2>class.</FONT>
</P>

<P><FONT SIZE=3D2>This is what I had done.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>However, I had the time finally to conduce the =
following tests.</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create a Product P1 </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Note: I used the =
word &quot;package&quot; instead of Product in my previous =
postings)</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create a Class A in P1</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create a method z in the Class A</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create a Product P2</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create a Class AA that inherits A in product =
P2.</FONT>
<BR><FONT SIZE=3D2>&nbsp;- create an object 'o' instance of Class =
AA.</FONT>
<BR><FONT SIZE=3D2>&nbsp;- make the test of calling the method z on =
'o'.</FONT>
</P>

<P><FONT SIZE=3D2>Results: everything works fine !!</FONT>
<BR><FONT SIZE=3D2>So everything seems to work correctly with the new =
version.</FONT>
</P>

<P><FONT SIZE=3D2>However, when I try to do the same (create a method z =
and test) for Packages</FONT>
<BR><FONT SIZE=3D2>that I had created in the previous version of Zope, =
it just does not work !!</FONT>
<BR><FONT SIZE=3D2>(I have imported in the new version the class I had =
created in the previous</FONT>
<BR><FONT SIZE=3D2>version).</FONT>
</P>

<P><FONT SIZE=3D2>I believe that this had to do with the trick I used =
to split and existing Product</FONT>
<BR><FONT SIZE=3D2>in several Products: Since I could not move a class =
directly from a package to another,</FONT>
<BR><FONT SIZE=3D2>I created 2 copies of the same packages. I deleted =
from the first package the class I wanted</FONT>
<BR><FONT SIZE=3D2>to move. From the second package, I deleted the =
classes I didn't want to move.</FONT>
<BR><FONT SIZE=3D2>The result was 2 packages with each the correct set =
of classes.</FONT>
<BR><FONT SIZE=3D2>The problem is that this seems to have generated =
some kind of inconsistancy,</FONT>
<BR><FONT SIZE=3D2>in particular related to the namespace: the second =
package do not have access to</FONT>
<BR><FONT SIZE=3D2>the namespace of the first package.</FONT>
</P>

<P><FONT SIZE=3D2>I know this was a relatively ugly way to proceed, but =
I found at that having</FONT>
<BR><FONT SIZE=3D2>a zillion of classes in a same package was even more =
ugly, and I needed to reduce</FONT>
<BR><FONT SIZE=3D2>this complexity by introducing more =
modularity.</FONT>
</P>

<P><FONT SIZE=3D2>Of course, at the beginning I couldn't predict which =
Products and which classes</FONT>
<BR><FONT SIZE=3D2>&nbsp;would exist and I decided to start with one =
package and split it later.</FONT>
<BR><FONT SIZE=3D2>If you had nor noticed I used some kind of =
incremental/prototypical/evolutionary/blablabla</FONT>
<BR><FONT SIZE=3D2>methodology.</FONT>
</P>

<P><FONT SIZE=3D2>Unfortunatly, not being able -- to move classes from =
one product to another -- makes</FONT>
<BR><FONT SIZE=3D2>the use of this methodology problematic :-(.</FONT>
</P>

<P><FONT SIZE=3D2>Another similar problem is that you can not modify a =
posteriori the inheritance tree.</FONT>
<BR><FONT SIZE=3D2>(for instance when you decompose a class into 2 =
subclasses that inherit from one another).</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>To conclude, I find Zope to be a very interesting =
systems (because it is dynamic,</FONT>
<BR><FONT SIZE=3D2>object-oriented, integrate seamlessly an OO =
database, etc.).</FONT>
<BR><FONT SIZE=3D2>However, it would be an even better system if it =
provided more flexibility to</FONT>
<BR><FONT SIZE=3D2>reengineer an architecture. (very important when you =
use a prototypical approach).</FONT>
</P>

<P><FONT SIZE=3D2>Or perhaps, there is something I have not understood =
?</FONT>
</P>

<P><FONT SIZE=3D2>Thierry Nabeth</FONT>
<BR><FONT SIZE=3D2>Research Fellow</FONT>
<BR><FONT SIZE=3D2>INSEAD CALT (the Centre for Advanced Learning =
Technologies)</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.insead.fr/CALT/" =
TARGET=3D"_blank">http://www.insead.fr/CALT/</A></FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Dieter Maurer [<A =
HREF=3D"mailto:dieter@handshake.de">mailto:dieter@handshake.de</A>]</FON=
T>
<BR><FONT SIZE=3D2>Sent: Monday, August 21, 2000 10:47 PM</FONT>
<BR><FONT SIZE=3D2>To: thierry.nabeth@insead.fr</FONT>
<BR><FONT SIZE=3D2>Subject: Re: RE[2]: [Zope] Product inheritance =
question (similar</FONT>
<BR><FONT SIZE=3D2>question)</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>NABETH Thierry writes:</FONT>
<BR><FONT SIZE=3D2>&nbsp;&gt; What I will have to do:</FONT>
<BR><FONT SIZE=3D2>&nbsp;&gt; - create a Package (Zope product).</FONT>
<BR><FONT SIZE=3D2>&nbsp;&gt; - create a class in this package, and a =
method (my_method)</FONT>
<BR><FONT SIZE=3D2>This should be a method of the class,</FONT>
<BR><FONT SIZE=3D2>not a method in the packages.</FONT>
</P>

<P><FONT SIZE=3D2>If it is a class method, it must be inherited by any =
derived</FONT>
<BR><FONT SIZE=3D2>class.</FONT>
</P>

<P><FONT SIZE=3D2>Dieter</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: NABETH Thierry </FONT>
<BR><FONT SIZE=3D2>Sent: Friday, August 18, 2000 9:29 AM</FONT>
<BR><FONT SIZE=3D2>To: 'zope@zope.org'</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [Zope] Product inhetitance question =
(similar question)</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>And what happen if the Class A is in a package =
PA.</FONT>
<BR><FONT SIZE=3D2>Clabb B is in a package PB.</FONT>
</P>

<P><FONT SIZE=3D2>How do you access the namespace of PA from PB =
?</FONT>
</P>

<P><FONT SIZE=3D2>When I have tried, the inherited methods from A where =
not visible</FONT>
<BR><FONT SIZE=3D2>from B, and I and to recreate a copie of the =
method.</FONT>
<BR><FONT SIZE=3D2>(which is ugly !!!).</FONT>
</P>

<P><FONT SIZE=3D2>Any suggestion ?</FONT>
</P>

<P><FONT SIZE=3D2>Thierry Nabeth</FONT>
<BR><FONT SIZE=3D2>Research Fellow</FONT>
<BR><FONT SIZE=3D2>INSEAD CALT (the Centre for Advanced Learning =
Technologies)</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.insead.fr/CALT/" =
TARGET=3D"_blank">http://www.insead.fr/CALT/</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C012AB.919B806E--