RE[3]: [Zope] Product inheritance question. ==> Pb. moving clas s from a product to another + etc. s from a product to another + etc.
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/
participants (1)
-
NABETH Thierry