[Zope] Product inhetitance question (similar question)

NABETH Thierry Thierry.NABETH@insead.fr
Fri, 18 Aug 2000 09:29:26 +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_01C008E5.4475A9CE
Content-Type: text/plain;
	charset="iso-8859-1"



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/


------------------------------------------
From: "Andy McKay" <AndyM@ActiveState.com>
To: "Daniel Rusch" <drusch@globalcrossing.com>, <zope@zope.org>
Subject: Re: [Zope] Product inhetitance question
Date: Thu, 17 Aug 2000 08:54:49 -0700
charset="iso-8859-1"

> Say I have a fully functional (and more importantly, working) Product
> will call A.
>
> I want to extend this Product's capabilities so I wish to derive another
> class from it, call it B.
>
> No problem,
>
> class B(A):
>     .........
>
>
> The question is, (I think the answer is no) is there a way to inherit
> (i.e. reuse common code and extend it) the manage_Add function and the
> dtml files from A???

Well by inheritance B has all the methods, properties etc you have in A. So
the answer is yes, if A has the foobar method then B will have a foobar
method.

Or do I misunderstand your question?
--
     Andy McKay, Developer, ActiveState
     http://www.ActiveState.com
     Programming for the People

------------------------------------------

------_=_NextPart_001_01C008E5.4475A9CE
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.2650.12">
<TITLE>RE: [Zope] Product inhetitance question (similar question)</TITLE>
</HEAD>
<BODY>
<BR>
<BR>

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

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

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

<P><FONT SIZE=2>Any suggestion ?</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.fr/CALT/" TARGET="_blank">http://www.insead.fr/CALT/</A></FONT>
</P>
<BR>

<P><FONT SIZE=2>------------------------------------------</FONT>
<BR><FONT SIZE=2>From: &quot;Andy McKay&quot; &lt;AndyM@ActiveState.com&gt;</FONT>
<BR><FONT SIZE=2>To: &quot;Daniel Rusch&quot; &lt;drusch@globalcrossing.com&gt;, &lt;zope@zope.org&gt;</FONT>
<BR><FONT SIZE=2>Subject: Re: [Zope] Product inhetitance question</FONT>
<BR><FONT SIZE=2>Date: Thu, 17 Aug 2000 08:54:49 -0700</FONT>
<BR><FONT SIZE=2>charset=&quot;iso-8859-1&quot;</FONT>
</P>

<P><FONT SIZE=2>&gt; Say I have a fully functional (and more importantly, working) Product</FONT>
<BR><FONT SIZE=2>&gt; will call A.</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; I want to extend this Product's capabilities so I wish to derive another</FONT>
<BR><FONT SIZE=2>&gt; class from it, call it B.</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; No problem,</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; class B(A):</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; .........</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; The question is, (I think the answer is no) is there a way to inherit</FONT>
<BR><FONT SIZE=2>&gt; (i.e. reuse common code and extend it) the manage_Add function and the</FONT>
<BR><FONT SIZE=2>&gt; dtml files from A???</FONT>
</P>

<P><FONT SIZE=2>Well by inheritance B has all the methods, properties etc you have in A. So</FONT>
<BR><FONT SIZE=2>the answer is yes, if A has the foobar method then B will have a foobar</FONT>
<BR><FONT SIZE=2>method.</FONT>
</P>

<P><FONT SIZE=2>Or do I misunderstand your question?</FONT>
<BR><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; Andy McKay, Developer, ActiveState</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.ActiveState.com" TARGET="_blank">http://www.ActiveState.com</A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; Programming for the People</FONT>
</P>

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

</BODY>
</HTML>
------_=_NextPart_001_01C008E5.4475A9CE--